host-test.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. .host_test_template:
  2. extends: .rules:labels:host_test
  3. stage: host_test
  4. image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
  5. tags:
  6. - host_test
  7. dependencies: []
  8. .host_fuzzer_test_template:
  9. extends:
  10. - .host_test_template
  11. - .rules:labels:fuzzer_test-weekend_test-only
  12. image: $CI_DOCKER_REGISTRY/afl-fuzzer-test
  13. artifacts:
  14. when: always
  15. paths:
  16. - ${FUZZER_TEST_DIR}/out/crashes
  17. - ${FUZZER_TEST_DIR}/fuzz_output.log
  18. expire_in: 1 week
  19. script:
  20. - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
  21. - cd ${FUZZER_TEST_DIR}
  22. # run AFL fuzzer for one hour
  23. - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.log | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
  24. - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
  25. # check no crashes found
  26. - test -z "$(ls out/crashes/)" || exit 1
  27. test_nvs_on_host:
  28. extends: .host_test_template
  29. script:
  30. - cd components/nvs_flash/test_nvs_host
  31. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh make test
  32. test_nvs_coverage:
  33. extends:
  34. - .host_test_template
  35. - .rules:labels:nvs_coverage-only
  36. artifacts:
  37. paths:
  38. - components/nvs_flash/test_nvs_host/coverage_report
  39. expire_in: 1 week
  40. script:
  41. - cd components/nvs_flash/test_nvs_host
  42. - make coverage_report
  43. test_partition_table_on_host:
  44. extends: .host_test_template
  45. tags:
  46. - build
  47. script:
  48. - cd components/partition_table/test_gen_esp32part_host
  49. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./gen_esp32part_tests.py
  50. test_wl_on_host:
  51. extends: .host_test_template
  52. artifacts:
  53. paths:
  54. - components/wear_levelling/test_wl_host/coverage_report.zip
  55. expire_in: 1 week
  56. script:
  57. - cd components/wear_levelling/test_wl_host
  58. - make test
  59. test_fatfs_on_host:
  60. extends: .host_test_template
  61. script:
  62. - cd components/fatfs/test_fatfs_host/
  63. - make test
  64. test_ldgen_on_host:
  65. extends: .host_test_template
  66. script:
  67. - cd tools/ldgen/test
  68. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_fragments.py
  69. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_generation.py
  70. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_entity.py
  71. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_output_commands.py
  72. variables:
  73. LC_ALL: C.UTF-8
  74. test_mdns_fuzzer_on_host:
  75. extends: .host_fuzzer_test_template
  76. variables:
  77. FUZZER_TEST_DIR: components/mdns/test_afl_fuzz_host
  78. test_lwip_dns_fuzzer_on_host:
  79. extends: .host_fuzzer_test_template
  80. variables:
  81. FUZZER_TEST_DIR: components/lwip/test_afl_host
  82. FUZZER_PARAMS: MODE=dns
  83. test_lwip_dhcp_fuzzer_on_host:
  84. extends: .host_fuzzer_test_template
  85. variables:
  86. FUZZER_TEST_DIR: components/lwip/test_afl_host
  87. FUZZER_PARAMS: MODE=dhcp_client
  88. test_lwip_dhcps_fuzzer_on_host:
  89. extends: .host_fuzzer_test_template
  90. variables:
  91. FUZZER_TEST_DIR: components/lwip/test_afl_host
  92. FUZZER_PARAMS: MODE=dhcp_server
  93. test_compile_fuzzers:
  94. extends: .host_test_template
  95. image: $CI_DOCKER_REGISTRY/afl-fuzzer-test
  96. script:
  97. - cd ${IDF_PATH}/components/lwip/test_afl_host
  98. - make MODE=dhcp_server
  99. - make MODE=dhcp_client
  100. - make MODE=dns
  101. - cd ${IDF_PATH}/components/mdns/test_afl_fuzz_host
  102. - make
  103. test_spiffs_on_host:
  104. extends: .host_test_template
  105. script:
  106. - cd components/spiffs/test_spiffs_host/
  107. - make test
  108. test_multi_heap_on_host:
  109. extends: .host_test_template
  110. script:
  111. - cd components/heap/test_multi_heap_host
  112. - ./test_all_configs.sh
  113. test_certificate_bundle_on_host:
  114. extends: .host_test_template
  115. tags:
  116. - build
  117. script:
  118. - cd components/mbedtls/esp_crt_bundle/test_gen_crt_bundle/
  119. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_gen_crt_bundle.py
  120. test_confserver:
  121. extends: .host_test_template
  122. script:
  123. - cd tools/kconfig_new/test/confserver
  124. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_confserver.py
  125. test_gen_kconfig_doc:
  126. extends: .host_test_template
  127. script:
  128. - cd tools/kconfig_new/test/gen_kconfig_doc/
  129. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_target_visibility.py
  130. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_kconfig_out.py
  131. test_confgen:
  132. extends: .host_test_template
  133. script:
  134. - cd tools/kconfig_new/test/confgen/
  135. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_confgen.py
  136. test_idf_monitor:
  137. extends: .host_test_template
  138. artifacts:
  139. # save artifacts always in order to access results which were retried without consequent failure
  140. when: always
  141. paths:
  142. - tools/test_idf_monitor/outputs/*
  143. expire_in: 1 week
  144. script:
  145. - cd ${IDF_PATH}/tools/test_idf_monitor
  146. - ./run_test_idf_monitor.py
  147. test_idf_size:
  148. extends: .host_test_template
  149. artifacts:
  150. when: on_failure
  151. paths:
  152. - tools/test_idf_size/output
  153. - tools/test_idf_size/.coverage
  154. expire_in: 1 week
  155. script:
  156. - cd ${IDF_PATH}/tools/test_idf_size
  157. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
  158. test_idf_py:
  159. extends: .host_test_template
  160. variables:
  161. LC_ALL: C.UTF-8
  162. script:
  163. - cd ${IDF_PATH}/tools/test_idf_py
  164. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_idf_py.py
  165. test_idf_tools:
  166. extends: .host_test_template
  167. artifacts:
  168. when: on_failure
  169. paths:
  170. - tools/tools.new.json
  171. expire_in: 1 week
  172. script:
  173. # Remove Xtensa and ULP toolchains from the PATH, tests will expect a clean environment
  174. - export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -v "/root/.espressif/tools\|/opt/espressif" | tr "\n" ":"); echo ${p%:})
  175. - cd ${IDF_PATH}/tools/test_idf_tools
  176. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_idf_tools.py
  177. test_esp_err_to_name_on_host:
  178. extends: .host_test_template
  179. artifacts:
  180. when: on_failure
  181. paths:
  182. - components/esp32/esp_err_to_name.c
  183. expire_in: 1 week
  184. script:
  185. - cd ${IDF_PATH}/tools/
  186. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./gen_esp_err_to_name.py
  187. - git diff --exit-code -- ../components/esp_common/src/esp_err_to_name.c || { echo 'Differences found. Please run gen_esp_err_to_name.py and commit the changes.'; exit 1; }
  188. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./gen_esp_err_to_name.py
  189. - git diff --exit-code -- ../components/esp_common/src/esp_err_to_name.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
  190. .test_efuse_table_on_host_template:
  191. extends: .host_test_template
  192. variables:
  193. IDF_TARGET: "esp32"
  194. artifacts:
  195. when: on_failure
  196. paths:
  197. - components/efuse/${IDF_TARGET}/esp_efuse_table.c
  198. expire_in: 1 week
  199. script:
  200. - cd ${IDF_PATH}/components/efuse/
  201. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./efuse_table_gen.py -t "${IDF_TARGET}" ${IDF_PATH}/components/efuse/${IDF_TARGET}/esp_efuse_table.csv
  202. - git diff --exit-code -- ${IDF_TARGET}/esp_efuse_table.c || { echo 'Differences found for ${IDF_TARGET} target. Please run make efuse_common_table or idf.py efuse_common_table and commit the changes.'; exit 1; }
  203. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./efuse_table_gen.py -t "${IDF_TARGET}" ${IDF_PATH}/components/efuse/${IDF_TARGET}/esp_efuse_table.csv
  204. - git diff --exit-code -- ${IDF_TARGET}/esp_efuse_table.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
  205. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  206. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./efuse_tests.py
  207. test_efuse_table_on_host_esp32:
  208. extends: .test_efuse_table_on_host_template
  209. test_efuse_table_on_host_esp32s2:
  210. extends: .test_efuse_table_on_host_template
  211. variables:
  212. IDF_TARGET: esp32s2
  213. test_efuse_table_on_host_esp32s3:
  214. extends: .test_efuse_table_on_host_template
  215. variables:
  216. IDF_TARGET: esp32s3
  217. test_efuse_table_on_host_esp32c3:
  218. extends: .test_efuse_table_on_host_template
  219. variables:
  220. IDF_TARGET: esp32c3
  221. test_espcoredump:
  222. extends: .host_test_template
  223. artifacts:
  224. when: always
  225. paths:
  226. - components/espcoredump/test/.coverage
  227. - components/espcoredump/test/output
  228. expire_in: 1 week
  229. script:
  230. - cd components/espcoredump/test/
  231. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_espcoredump.sh
  232. test_logtrace_proc:
  233. extends: .host_test_template
  234. artifacts:
  235. when: on_failure
  236. paths:
  237. - tools/esp_app_trace/test/logtrace/output
  238. - tools/esp_app_trace/test/logtrace/.coverage
  239. expire_in: 1 week
  240. script:
  241. - cd ${IDF_PATH}/tools/esp_app_trace/test/logtrace
  242. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
  243. test_sysviewtrace_proc:
  244. extends: .host_test_template
  245. artifacts:
  246. when: on_failure
  247. paths:
  248. - tools/esp_app_trace/test/sysview/output
  249. - tools/esp_app_trace/test/sysview/.coverage
  250. expire_in: 1 week
  251. script:
  252. - cd ${IDF_PATH}/tools/esp_app_trace/test/sysview
  253. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
  254. test_mkdfu:
  255. extends: .host_test_template
  256. variables:
  257. LC_ALL: C.UTF-8
  258. script:
  259. - cd ${IDF_PATH}/tools/test_mkdfu
  260. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_mkdfu.py
  261. test_mkuf2:
  262. extends: .host_test_template
  263. script:
  264. - cd ${IDF_PATH}/tools/test_mkuf2
  265. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_mkuf2.py
  266. test_docs:
  267. extends: .host_test_template
  268. image: $ESP_IDF_DOC_ENV_IMAGE
  269. artifacts:
  270. when: on_failure
  271. paths:
  272. - docs/test/_build/*/*/*/html/*
  273. expire_in: 1 week
  274. script:
  275. - cd ${IDF_PATH}/docs/test
  276. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.6.10 pip install -r ${IDF_PATH}/docs/requirements.txt
  277. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.6.10 ./test_docs.py
  278. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.6.10 ./test_sphinx_idf_extensions.py
  279. test_autocomplete:
  280. extends: .host_test_template
  281. image: $CI_DOCKER_REGISTRY/linux-shells:1
  282. artifacts:
  283. when: on_failure
  284. paths:
  285. - ${IDF_PATH}/*.out
  286. expire_in: 1 week
  287. script:
  288. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ${IDF_PATH}/tools/ci/test_autocomplete.py
  289. test_detect_python:
  290. extends: .host_test_template
  291. image: $CI_DOCKER_REGISTRY/linux-shells:1
  292. script:
  293. - cd ${IDF_PATH}
  294. - shellcheck -s sh tools/detect_python.sh
  295. - shellcheck -s bash tools/detect_python.sh
  296. - shellcheck -s dash tools/detect_python.sh
  297. - "bash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  298. - "dash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  299. - "zsh -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  300. - "fish -c 'source tools/detect_python.fish && echo Our Python: $ESP_PYTHON'"
  301. test_nvs_page:
  302. extends: .host_test_template
  303. script:
  304. - cd ${IDF_PATH}/components/nvs_flash/host_test/nvs_page_test
  305. - idf.py build
  306. - build/host_nvs_page_test.elf