host-test.yml 11 KB

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