host-test.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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. script:
  168. # Remove Xtensa and ULP toolchains from the PATH, tests will expect a clean environment
  169. - export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -v "/root/.espressif/tools\|/opt/espressif" | tr "\n" ":"); echo ${p%:})
  170. - cd ${IDF_PATH}/tools/test_idf_tools
  171. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_idf_tools.py
  172. test_esp_err_to_name_on_host:
  173. extends: .host_test_template
  174. artifacts:
  175. when: on_failure
  176. paths:
  177. - components/esp32/esp_err_to_name.c
  178. expire_in: 1 week
  179. script:
  180. - cd ${IDF_PATH}/tools/
  181. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./gen_esp_err_to_name.py
  182. - 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; }
  183. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./gen_esp_err_to_name.py
  184. - 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; }
  185. test_esp32_efuse_table_on_host:
  186. extends: .host_test_template
  187. artifacts:
  188. when: on_failure
  189. paths:
  190. - components/efuse/esp32/esp_efuse_table.c
  191. expire_in: 1 week
  192. script:
  193. - cd ${IDF_PATH}/components/efuse/
  194. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./efuse_table_gen.py ${IDF_PATH}/components/efuse/esp32/esp_efuse_table.csv
  195. - git diff --exit-code -- esp32/esp_efuse_table.c || { echo 'Differences found for esp32 target. Please run make efuse_common_table or idf.py efuse_common_table and commit the changes.'; exit 1; }
  196. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./efuse_table_gen.py ${IDF_PATH}/components/efuse/esp32/esp_efuse_table.csv
  197. - git diff --exit-code -- esp32/esp_efuse_table.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
  198. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  199. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./efuse_tests.py
  200. test_esp32s2_efuse_table_on_host:
  201. extends: .host_test_template
  202. artifacts:
  203. when: on_failure
  204. paths:
  205. - components/efuse/esp32s2/esp_efuse_table.c
  206. expire_in: 1 week
  207. script:
  208. - cd ${IDF_PATH}/components/efuse/
  209. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./efuse_table_gen.py -t "esp32s2" ${IDF_PATH}/components/efuse/esp32s2/esp_efuse_table.csv
  210. - git diff --exit-code -- esp32s2/esp_efuse_table.c || { echo 'Differences found for esp32s2 target. Please run make efuse_common_table or idf.py efuse_common_table and commit the changes.'; exit 1; }
  211. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./efuse_table_gen.py -t "esp32s2" ${IDF_PATH}/components/efuse/esp32s2/esp_efuse_table.csv
  212. - git diff --exit-code -- esp32s2/esp_efuse_table.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
  213. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  214. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./efuse_tests.py
  215. test_esp32s3_efuse_table_on_host:
  216. extends: .host_test_template
  217. artifacts:
  218. when: on_failure
  219. paths:
  220. - components/efuse/esp32s3/esp_efuse_table.c
  221. expire_in: 1 week
  222. script:
  223. - cd ${IDF_PATH}/components/efuse/
  224. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./efuse_table_gen.py -t "esp32s3" ${IDF_PATH}/components/efuse/esp32s3/esp_efuse_table.csv
  225. - git diff --exit-code -- esp32s3/esp_efuse_table.c || { echo 'Differences found for esp32s3 target. Please run make efuse_common_table or idf.py efuse_common_table and commit the changes.'; exit 1; }
  226. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./efuse_table_gen.py -t "esp32s3" ${IDF_PATH}/components/efuse/esp32s3/esp_efuse_table.csv
  227. - git diff --exit-code -- esp32s3/esp_efuse_table.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
  228. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  229. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./efuse_tests.py
  230. test_esp32c3_efuse_table_on_host:
  231. extends: .host_test_template
  232. artifacts:
  233. when: on_failure
  234. paths:
  235. - components/efuse/esp32c3/esp_efuse_table.c
  236. expire_in: 1 week
  237. script:
  238. - cd ${IDF_PATH}/components/efuse/
  239. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./efuse_table_gen.py -t "esp32c3" ${IDF_PATH}/components/efuse/esp32c3/esp_efuse_table.csv
  240. - git diff --exit-code -- esp32c3/esp_efuse_table.c || { echo 'Differences found for esp32c3 target. Please run make efuse_common_table or idf.py efuse_common_table and commit the changes.'; exit 1; }
  241. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./efuse_table_gen.py -t "esp32c3" ${IDF_PATH}/components/efuse/esp32c3/esp_efuse_table.csv
  242. - git diff --exit-code -- esp32c3/esp_efuse_table.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
  243. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  244. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./efuse_tests.py
  245. test_espcoredump:
  246. extends: .host_test_template
  247. artifacts:
  248. when: always
  249. paths:
  250. - components/espcoredump/test/.coverage
  251. - components/espcoredump/test/output
  252. expire_in: 1 week
  253. script:
  254. - cd components/espcoredump/test/
  255. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_espcoredump.sh
  256. test_logtrace_proc:
  257. extends: .host_test_template
  258. artifacts:
  259. when: on_failure
  260. paths:
  261. - tools/esp_app_trace/test/logtrace/output
  262. - tools/esp_app_trace/test/logtrace/.coverage
  263. expire_in: 1 week
  264. script:
  265. - cd ${IDF_PATH}/tools/esp_app_trace/test/logtrace
  266. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
  267. test_sysviewtrace_proc:
  268. extends: .host_test_template
  269. artifacts:
  270. when: on_failure
  271. paths:
  272. - tools/esp_app_trace/test/sysview/output
  273. - tools/esp_app_trace/test/sysview/.coverage
  274. expire_in: 1 week
  275. script:
  276. - cd ${IDF_PATH}/tools/esp_app_trace/test/sysview
  277. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
  278. test_mkdfu:
  279. extends: .host_test_template
  280. variables:
  281. LC_ALL: C.UTF-8
  282. script:
  283. - cd ${IDF_PATH}/tools/test_mkdfu
  284. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_mkdfu.py
  285. test_mkuf2:
  286. extends: .host_test_template
  287. script:
  288. - cd ${IDF_PATH}/tools/test_mkuf2
  289. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_mkuf2.py
  290. test_docs:
  291. extends: .host_test_template
  292. image: $ESP_IDF_DOC_ENV_IMAGE
  293. artifacts:
  294. when: on_failure
  295. paths:
  296. - docs/test/_build/*/*/*/html/*
  297. expire_in: 1 week
  298. script:
  299. - cd ${IDF_PATH}/docs/test
  300. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.6.10 pip install -r ${IDF_PATH}/docs/requirements.txt
  301. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.6.10 ./test_docs.py
  302. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.6.10 ./test_sphinx_idf_extensions.py
  303. test_autocomplete:
  304. extends: .host_test_template
  305. image: $CI_DOCKER_REGISTRY/linux-shells:1
  306. artifacts:
  307. when: on_failure
  308. paths:
  309. - ${IDF_PATH}/*.out
  310. expire_in: 1 week
  311. script:
  312. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ${IDF_PATH}/tools/ci/test_autocomplete.py
  313. test_detect_python:
  314. extends: .host_test_template
  315. image: $CI_DOCKER_REGISTRY/linux-shells:1
  316. script:
  317. - cd ${IDF_PATH}
  318. - shellcheck -s sh tools/detect_python.sh
  319. - shellcheck -s bash tools/detect_python.sh
  320. - shellcheck -s dash tools/detect_python.sh
  321. - "bash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  322. - "dash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  323. - "zsh -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  324. - "fish -c 'source tools/detect_python.fish && echo Our Python: $ESP_PYTHON'"