host-test.yml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. .host_test_template:
  2. extends: .rules:test:host_test
  3. stage: host_test
  4. image: $ESP_ENV_IMAGE
  5. tags:
  6. - host_test
  7. dependencies: # set dependencies to null to avoid missing artifacts issue
  8. # run host_test jobs immediately, only after upload cache
  9. needs:
  10. - job: upload-pip-cache
  11. optional: true
  12. artifacts: false
  13. - job: upload-submodules-cache
  14. optional: true
  15. artifacts: false
  16. - pipeline_variables
  17. test_nvs_on_host:
  18. extends: .host_test_template
  19. script:
  20. - cd components/nvs_flash/test_nvs_host
  21. - make test
  22. test_nvs_coverage:
  23. extends:
  24. - .host_test_template
  25. - .rules:labels:nvs_coverage
  26. artifacts:
  27. paths:
  28. - components/nvs_flash/test_nvs_host/coverage_report
  29. expire_in: 1 week
  30. script:
  31. - cd components/nvs_flash/test_nvs_host
  32. - make coverage_report
  33. # the 'long' host tests take approx 11 hours on our current runners. Adding some margin here for possible CPU contention
  34. timeout: 18 hours
  35. test_partition_table_on_host:
  36. extends: .host_test_template
  37. script:
  38. - cd components/partition_table/test_gen_esp32part_host
  39. - ./gen_esp32part_tests.py
  40. test_ldgen_on_host:
  41. extends: .host_test_template
  42. script:
  43. - cd tools/ldgen/test
  44. - export PYTHONPATH=$PYTHONPATH:..
  45. - python -m unittest
  46. variables:
  47. LC_ALL: C.UTF-8
  48. test_reproducible_build:
  49. extends: .host_test_template
  50. script:
  51. - ./tools/ci/test_reproducible_build.sh
  52. artifacts:
  53. when: on_failure
  54. paths:
  55. - "**/sdkconfig"
  56. - "**/build*/*.bin"
  57. - "**/build*/*.elf"
  58. - "**/build*/*.map"
  59. - "**/build*/flasher_args.json"
  60. - "**/build*/*.bin"
  61. - "**/build*/bootloader/*.bin"
  62. - "**/build*/partition_table/*.bin"
  63. expire_in: 1 week
  64. test_spiffs_on_host:
  65. extends: .host_test_template
  66. script:
  67. - cd components/spiffs/test_spiffsgen/
  68. - ./test_spiffsgen.py
  69. test_fatfsgen_on_host:
  70. extends: .host_test_template
  71. script:
  72. - cd components/fatfs/test_fatfsgen/
  73. - ./test_fatfsgen.py
  74. - ./test_wl_fatfsgen.py
  75. - ./test_fatfsparse.py
  76. test_multi_heap_on_host:
  77. extends: .host_test_template
  78. script:
  79. - cd components/heap/test_multi_heap_host
  80. - ./test_all_configs.sh
  81. test_certificate_bundle_on_host:
  82. extends: .host_test_template
  83. script:
  84. - cd components/mbedtls/esp_crt_bundle/test_gen_crt_bundle/
  85. - ./test_gen_crt_bundle.py
  86. test_gdbstub_on_host:
  87. extends: .host_test_template
  88. script:
  89. - cd components/esp_gdbstub/test_gdbstub_host
  90. - make test
  91. test_idf_py:
  92. extends: .host_test_template
  93. variables:
  94. LC_ALL: C.UTF-8
  95. script:
  96. - cd ${IDF_PATH}/tools/test_idf_py
  97. - ./test_idf_py.py
  98. - ./test_hints.py
  99. # Test for create virtualenv. It must be invoked from Python, not from virtualenv.
  100. # Use docker image system python without any extra dependencies
  101. test_idf_tools:
  102. extends:
  103. - .host_test_template
  104. - .before_script:minimal
  105. artifacts:
  106. when: on_failure
  107. paths:
  108. - tools/tools.new.json
  109. - tools/test_idf_tools/test_python_env_logs.txt
  110. expire_in: 1 week
  111. image:
  112. name: $ESP_ENV_IMAGE
  113. entrypoint: [""] # use system python3. no extra pip package installed
  114. script:
  115. # Tools must be downloaded for testing
  116. - python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa
  117. - cd ${IDF_PATH}/tools/test_idf_tools
  118. - python3 -m pip install jsonschema
  119. - python3 ./test_idf_tools.py -v
  120. - python3 ./test_idf_tools_python_env.py
  121. .test_efuse_table_on_host_template:
  122. extends: .host_test_template
  123. variables:
  124. IDF_TARGET: "esp32"
  125. artifacts:
  126. when: on_failure
  127. paths:
  128. - components/efuse/${IDF_TARGET}/esp_efuse_table.c
  129. expire_in: 1 week
  130. script:
  131. - cd ${IDF_PATH}/components/efuse/
  132. - ./efuse_table_gen.py -t "${IDF_TARGET}" ${IDF_PATH}/components/efuse/${IDF_TARGET}/esp_efuse_table.csv
  133. - git diff --exit-code -- ${IDF_TARGET}/esp_efuse_table.c || { echo 'Differences found for ${IDF_TARGET} target. Please run idf.py efuse-common-table and commit the changes.'; exit 1; }
  134. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  135. - ./efuse_tests.py
  136. test_efuse_table_on_host_esp32:
  137. extends: .test_efuse_table_on_host_template
  138. test_efuse_table_on_host_esp32s2:
  139. extends: .test_efuse_table_on_host_template
  140. variables:
  141. IDF_TARGET: esp32s2
  142. test_efuse_table_on_host_esp32s3:
  143. extends: .test_efuse_table_on_host_template
  144. variables:
  145. IDF_TARGET: esp32s3
  146. test_efuse_table_on_host_esp32c3:
  147. extends: .test_efuse_table_on_host_template
  148. variables:
  149. IDF_TARGET: esp32c3
  150. test_efuse_table_on_host_esp32h2:
  151. extends: .test_efuse_table_on_host_template
  152. variables:
  153. IDF_TARGET: esp32h2
  154. test_efuse_table_on_host_esp32c6:
  155. extends: .test_efuse_table_on_host_template
  156. variables:
  157. IDF_TARGET: esp32c6
  158. test_logtrace_proc:
  159. extends: .host_test_template
  160. artifacts:
  161. when: on_failure
  162. paths:
  163. - tools/esp_app_trace/test/logtrace/output
  164. - tools/esp_app_trace/test/logtrace/.coverage
  165. expire_in: 1 week
  166. script:
  167. - cd ${IDF_PATH}/tools/esp_app_trace/test/logtrace
  168. - ./test.sh
  169. test_sysviewtrace_proc:
  170. extends: .host_test_template
  171. artifacts:
  172. when: on_failure
  173. paths:
  174. - tools/esp_app_trace/test/sysview/output
  175. - tools/esp_app_trace/test/sysview/.coverage
  176. expire_in: 1 week
  177. script:
  178. - cd ${IDF_PATH}/tools/esp_app_trace/test/sysview
  179. - ./test.sh
  180. test_mkdfu:
  181. extends: .host_test_template
  182. variables:
  183. LC_ALL: C.UTF-8
  184. script:
  185. - cd ${IDF_PATH}/tools/test_mkdfu
  186. - ./test_mkdfu.py
  187. test_sbom:
  188. extends:
  189. - .host_test_template
  190. - .rules:patterns:sbom
  191. script:
  192. - cd ${IDF_PATH}/tools/test_sbom
  193. - pytest
  194. test_autocomplete:
  195. extends:
  196. - .host_test_template
  197. artifacts:
  198. when: on_failure
  199. paths:
  200. - ${IDF_PATH}/*.out
  201. expire_in: 1 week
  202. script:
  203. - ${IDF_PATH}/tools/ci/test_autocomplete.py
  204. test_detect_python:
  205. extends:
  206. - .host_test_template
  207. script:
  208. - cd ${IDF_PATH}
  209. - shellcheck -s sh tools/detect_python.sh
  210. - shellcheck -s bash tools/detect_python.sh
  211. - shellcheck -s dash tools/detect_python.sh
  212. - "bash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  213. - "dash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  214. - "zsh -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  215. - "fish -c 'source tools/detect_python.fish && echo Our Python: $ESP_PYTHON'"
  216. test_split_path_by_spaces:
  217. extends: .host_test_template
  218. script:
  219. - cd ${IDF_PATH}/tools
  220. - python -m unittest split_paths_by_spaces.py
  221. test_mqtt_on_host:
  222. extends: .host_test_template
  223. script:
  224. - cd ${IDF_PATH}/components/mqtt/esp-mqtt/host_test
  225. - idf.py build
  226. - LSAN_OPTIONS=verbosity=1:log_threads=1 build/host_mqtt_client_test.elf
  227. test_transport_on_host:
  228. extends: .host_test_template
  229. script:
  230. - cd ${IDF_PATH}/components/tcp_transport/host_test
  231. - idf.py build
  232. - LSAN_OPTIONS=verbosity=1:log_threads=1 build/host_tcp_transport_test.elf
  233. test_sockets_on_host:
  234. extends: .host_test_template
  235. script:
  236. # test the tcp-client example with system sockets
  237. - cd ${IDF_PATH}/examples/protocols/sockets/tcp_client
  238. - echo 'CONFIG_EXAMPLE_IPV4_ADDR="127.0.0.1"' >> sdkconfig.defaults
  239. - idf.py --preview set-target linux
  240. - idf.py build
  241. - timeout 5 ./build/tcp_client.elf >test.log || true
  242. - grep "Socket unable to connect" test.log
  243. # test the udp-client example with lwip sockets
  244. - cd ${IDF_PATH}/examples/protocols/sockets/udp_client
  245. - idf.py --preview set-target linux
  246. - cat sdkconfig.ci.linux > sdkconfig
  247. - idf.py build
  248. - timeout 5 ./build/udp_client.elf >test.log || true
  249. - grep "Message sent" test.log
  250. test_eh_frame_parser:
  251. extends: .host_test_template
  252. script:
  253. - cd ${IDF_PATH}/components/esp_system/test_eh_frame_parser
  254. - make
  255. - ./eh_frame_test
  256. test_gen_soc_caps_kconfig:
  257. extends: .host_test_template
  258. script:
  259. - cd ${IDF_PATH}/tools/gen_soc_caps_kconfig/
  260. - ./test/test_gen_soc_caps_kconfig.py
  261. test_pytest_qemu:
  262. extends:
  263. - .host_test_template
  264. - .before_script:build
  265. image: $QEMU_IMAGE
  266. artifacts:
  267. when: always
  268. paths:
  269. - XUNIT_RESULT.xml
  270. - pytest_embedded_log/
  271. reports:
  272. junit: XUNIT_RESULT.xml
  273. expire_in: 1 week
  274. allow_failure: true # IDFCI-1752
  275. parallel:
  276. matrix:
  277. - IDF_TARGET: [esp32, esp32c3]
  278. script:
  279. - run_cmd python tools/ci/ci_build_apps.py . -vv
  280. --target $IDF_TARGET
  281. --pytest-apps
  282. -m qemu
  283. --collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
  284. --modified-components ${MODIFIED_COMPONENTS}
  285. --modified-files ${MODIFIED_FILES}
  286. - retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
  287. - run_cmd pytest
  288. --target $IDF_TARGET
  289. -m qemu
  290. --embedded-services idf,qemu
  291. --junitxml=XUNIT_RESULT.xml
  292. --ignore-result-files known_failure_cases/known_failure_cases.txt
  293. --app-info-filepattern \"list_job_*.txt\"
  294. test_pytest_linux:
  295. extends:
  296. - .host_test_template
  297. - .before_script:build
  298. artifacts:
  299. when: always
  300. paths:
  301. - XUNIT_RESULT.xml
  302. - pytest_embedded_log/
  303. - "**/build*/build_log.txt"
  304. reports:
  305. junit: XUNIT_RESULT.xml
  306. expire_in: 1 week
  307. script:
  308. - run_cmd python tools/ci/ci_build_apps.py components examples tools/test_apps -vv
  309. --target linux
  310. --pytest-apps
  311. -m host_test
  312. --collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
  313. --modified-components ${MODIFIED_COMPONENTS}
  314. --modified-files ${MODIFIED_FILES}
  315. - retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
  316. - run_cmd pytest
  317. --target linux
  318. -m host_test
  319. --junitxml=XUNIT_RESULT.xml
  320. --ignore-result-files known_failure_cases/known_failure_cases.txt
  321. --app-info-filepattern \"list_job_*.txt\"