host-test.yml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. - 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. - 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_confserver:
  142. extends: .host_test_template
  143. script:
  144. - cd tools/kconfig_new/test
  145. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_confserver.py
  146. test_idf_monitor:
  147. extends: .host_test_template
  148. artifacts:
  149. # save artifacts always in order to access results which were retried without consequent failure
  150. when: always
  151. paths:
  152. - tools/test_idf_monitor/outputs/*
  153. expire_in: 1 week
  154. script:
  155. - cd ${IDF_PATH}/tools/test_idf_monitor
  156. - ./run_test_idf_monitor.py
  157. test_idf_size:
  158. extends: .host_test_template
  159. artifacts:
  160. when: on_failure
  161. paths:
  162. - tools/test_idf_size/output
  163. - tools/test_idf_size/.coverage
  164. expire_in: 1 week
  165. script:
  166. - cd ${IDF_PATH}/tools/test_idf_size
  167. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
  168. test_idf_tools:
  169. extends: .host_test_template
  170. script:
  171. # Remove Xtensa and ULP toolchains from the PATH, tests will expect a clean environment
  172. - export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -v "/root/.espressif/tools\|/opt/espressif" | tr "\n" ":"); echo ${p%:})
  173. - cd ${IDF_PATH}/tools/test_idf_tools
  174. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_idf_tools.py
  175. test_esp_err_to_name_on_host:
  176. extends: .host_test_template
  177. artifacts:
  178. when: on_failure
  179. paths:
  180. - components/esp32/esp_err_to_name.c
  181. expire_in: 1 week
  182. script:
  183. - cd ${IDF_PATH}/tools/
  184. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 2.7.15 ./gen_esp_err_to_name.py
  185. - 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; }
  186. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 ./gen_esp_err_to_name.py
  187. - 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; }
  188. test_esp_efuse_table_on_host:
  189. extends: .host_test_template
  190. artifacts:
  191. when: on_failure
  192. paths:
  193. - components/efuse/esp32/esp_efuse_table.c
  194. expire_in: 1 week
  195. script:
  196. - cd ${IDF_PATH}/components/efuse/
  197. - ${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
  198. - git diff --exit-code -- esp32/esp_efuse_table.c || { echo 'Differences found. Please run make efuse_common_table or idf.py efuse_common_table and commit the changes.'; exit 1; }
  199. - ${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
  200. - git diff --exit-code -- esp32/esp_efuse_table.c || { echo 'Differences found between running under Python 2 and 3.'; exit 1; }
  201. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  202. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./efuse_tests.py
  203. test_espcoredump:
  204. extends: .host_test_template
  205. artifacts:
  206. when: always
  207. paths:
  208. - components/espcoredump/test/.coverage
  209. - components/espcoredump/test/output
  210. expire_in: 1 week
  211. script:
  212. - cd components/espcoredump/test/
  213. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test_espcoredump.sh
  214. test_logtrace_proc:
  215. extends: .host_test_template
  216. artifacts:
  217. when: on_failure
  218. paths:
  219. - tools/esp_app_trace/test/logtrace/output
  220. - tools/esp_app_trace/test/logtrace/.coverage
  221. expire_in: 1 week
  222. script:
  223. - cd ${IDF_PATH}/tools/esp_app_trace/test/logtrace
  224. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
  225. test_sysviewtrace_proc:
  226. extends: .host_test_template
  227. artifacts:
  228. when: on_failure
  229. paths:
  230. - tools/esp_app_trace/test/sysview/output
  231. - tools/esp_app_trace/test/sysview/.coverage
  232. expire_in: 1 week
  233. script:
  234. - cd ${IDF_PATH}/tools/esp_app_trace/test/sysview
  235. - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh ./test.sh
  236. check_doc_links:
  237. stage: host_test
  238. image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
  239. tags:
  240. - check_doc_links
  241. only:
  242. refs:
  243. # can only be triggered
  244. - triggers
  245. variables:
  246. - $BOT_TRIGGER_WITH_LABEL == null
  247. - $BOT_LABEL_BUILD_DOCS
  248. artifacts:
  249. paths:
  250. - docs/_build/linkcheck
  251. expire_in: 1 week
  252. dependencies: []
  253. script:
  254. # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
  255. - test "$CHECK_LINKS" = "Yes" || exit 0
  256. # can only run on master branch (otherwise the commit is not on Github yet)
  257. - test "${CI_COMMIT_REF_NAME}" = "master" || exit 0
  258. - cd docs
  259. - make linkcheck