host-test.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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: []
  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. test_nvs_on_host:
  17. extends: .host_test_template
  18. script:
  19. - cd components/nvs_flash/test_nvs_host
  20. - make test
  21. test_nvs_coverage:
  22. extends:
  23. - .host_test_template
  24. - .rules:labels:nvs_coverage
  25. artifacts:
  26. paths:
  27. - components/nvs_flash/test_nvs_host/coverage_report
  28. expire_in: 1 week
  29. script:
  30. - cd components/nvs_flash/test_nvs_host
  31. - make coverage_report
  32. # the 'long' host tests take approx 11 hours on our current runners. Adding some margin here for possible CPU contention
  33. timeout: 18 hours
  34. test_partition_table_on_host:
  35. extends: .host_test_template
  36. tags:
  37. - build
  38. script:
  39. - cd components/partition_table/test_gen_esp32part_host
  40. - ./gen_esp32part_tests.py
  41. test_wl_on_host:
  42. extends: .host_test_template
  43. artifacts:
  44. paths:
  45. - components/wear_levelling/test_wl_host/coverage_report.zip
  46. expire_in: 1 week
  47. script:
  48. - cd components/wear_levelling/test_wl_host
  49. - make test
  50. test_fatfs_on_host:
  51. extends: .host_test_template
  52. script:
  53. - cd components/fatfs/test_fatfs_host/
  54. - make test
  55. test_ldgen_on_host:
  56. extends: .host_test_template
  57. script:
  58. - cd tools/ldgen/test
  59. - export PYTHONPATH=$PYTHONPATH:..
  60. - python -m unittest
  61. variables:
  62. LC_ALL: C.UTF-8
  63. test_reproducible_build:
  64. extends: .host_test_template
  65. script:
  66. - ./tools/ci/test_reproducible_build.sh
  67. artifacts:
  68. when: on_failure
  69. paths:
  70. - "**/sdkconfig"
  71. - "**/build*/*.bin"
  72. - "**/build*/*.elf"
  73. - "**/build*/*.map"
  74. - "**/build*/flasher_args.json"
  75. - "**/build*/*.bin"
  76. - "**/build*/bootloader/*.bin"
  77. - "**/build*/partition_table/*.bin"
  78. expire_in: 1 week
  79. .host_fuzzer_test_template:
  80. extends:
  81. - .host_test_template
  82. - .rules:labels:fuzzer_test-weekend_test
  83. image: $AFL_FUZZER_TEST_IMAGE
  84. artifacts:
  85. when: always
  86. paths:
  87. - ${FUZZER_TEST_DIR}/out/crashes
  88. - ${FUZZER_TEST_DIR}/fuzz_output.log
  89. expire_in: 1 week
  90. script:
  91. - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
  92. - cd ${FUZZER_TEST_DIR}
  93. # run AFL fuzzer for one hour
  94. - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.log | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
  95. - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
  96. # check no crashes found
  97. - test -z "$(ls out/crashes/)" || exit 1
  98. test_lwip_dns_fuzzer_on_host:
  99. extends: .host_fuzzer_test_template
  100. variables:
  101. FUZZER_TEST_DIR: components/lwip/test_afl_host
  102. FUZZER_PARAMS: MODE=dns
  103. test_lwip_dhcp_fuzzer_on_host:
  104. extends: .host_fuzzer_test_template
  105. variables:
  106. FUZZER_TEST_DIR: components/lwip/test_afl_host
  107. FUZZER_PARAMS: MODE=dhcp_client
  108. test_lwip_dhcps_fuzzer_on_host:
  109. extends: .host_fuzzer_test_template
  110. variables:
  111. FUZZER_TEST_DIR: components/lwip/test_afl_host
  112. FUZZER_PARAMS: MODE=dhcp_server
  113. test_spiffs_on_host:
  114. extends: .host_test_template
  115. script:
  116. - cd components/spiffs/test_spiffs_host/
  117. - make test
  118. - cd ../test_spiffsgen
  119. - ./test_spiffsgen.py
  120. test_fatfsgen_on_host:
  121. extends: .host_test_template
  122. script:
  123. - cd components/fatfs/test_fatfsgen/
  124. - ./test_fatfsgen.py
  125. - ./test_wl_fatfsgen.py
  126. - ./test_fatfsparse.py
  127. test_multi_heap_on_host:
  128. extends: .host_test_template
  129. script:
  130. - cd components/heap/test_multi_heap_host
  131. - ./test_all_configs.sh
  132. test_certificate_bundle_on_host:
  133. extends: .host_test_template
  134. tags:
  135. - build
  136. script:
  137. - cd components/mbedtls/esp_crt_bundle/test_gen_crt_bundle/
  138. - ./test_gen_crt_bundle.py
  139. test_confserver:
  140. extends: .host_test_template
  141. script:
  142. - cd tools/kconfig_new/test/confserver
  143. - ./test_confserver.py
  144. test_gen_kconfig_doc:
  145. extends: .host_test_template
  146. script:
  147. - cd tools/kconfig_new/test/gen_kconfig_doc/
  148. - ./test_target_visibility.py
  149. - ./test_kconfig_out.py
  150. test_confgen:
  151. extends: .host_test_template
  152. script:
  153. - cd tools/kconfig_new/test/confgen/
  154. - ./test_confgen.py
  155. test_idf_monitor:
  156. extends: .host_test_template
  157. artifacts:
  158. # save artifacts always in order to access results which were retried without consequent failure
  159. when: always
  160. paths:
  161. - tools/test_idf_monitor/outputs/*
  162. expire_in: 1 week
  163. script:
  164. - eval $($IDF_PATH/tools/idf_tools.py export)
  165. - cd ${IDF_PATH}/tools/test_idf_monitor
  166. - ./run_test_idf_monitor.py
  167. test_idf_size:
  168. extends: .host_test_template
  169. artifacts:
  170. when: on_failure
  171. paths:
  172. - tools/test_idf_size/output
  173. - tools/test_idf_size/.coverage
  174. expire_in: 1 week
  175. script:
  176. - cd ${IDF_PATH}/tools/test_idf_size
  177. - ./test.sh
  178. test_idf_py:
  179. extends: .host_test_template
  180. variables:
  181. LC_ALL: C.UTF-8
  182. script:
  183. - cd ${IDF_PATH}/tools/test_idf_py
  184. - ./test_idf_py.py
  185. # Test for create virtualenv. It must be invoked from Python, not from virtualenv.
  186. # Use docker image system python without any extra dependencies
  187. test_idf_tools:
  188. extends:
  189. - .host_test_template
  190. - .before_script_minimal
  191. artifacts:
  192. when: on_failure
  193. paths:
  194. - tools/tools.new.json
  195. - tools/test_idf_tools/test_python_env_logs.txt
  196. expire_in: 1 week
  197. image:
  198. name: $ESP_ENV_IMAGE
  199. entrypoint: [""] # use system python3. no extra pip package installed
  200. script:
  201. - cd ${IDF_PATH}/tools/test_idf_tools
  202. - python3 -m pip install jsonschema
  203. - python3 ./test_idf_tools.py
  204. - python3 ./test_idf_tools_python_env.py
  205. .test_efuse_table_on_host_template:
  206. extends: .host_test_template
  207. variables:
  208. IDF_TARGET: "esp32"
  209. artifacts:
  210. when: on_failure
  211. paths:
  212. - components/efuse/${IDF_TARGET}/esp_efuse_table.c
  213. expire_in: 1 week
  214. script:
  215. - cd ${IDF_PATH}/components/efuse/
  216. - ./efuse_table_gen.py -t "${IDF_TARGET}" ${IDF_PATH}/components/efuse/${IDF_TARGET}/esp_efuse_table.csv
  217. - 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; }
  218. - cd ${IDF_PATH}/components/efuse/test_efuse_host
  219. - ./efuse_tests.py
  220. test_efuse_table_on_host_esp32:
  221. extends: .test_efuse_table_on_host_template
  222. test_efuse_table_on_host_esp32s2:
  223. extends: .test_efuse_table_on_host_template
  224. variables:
  225. IDF_TARGET: esp32s2
  226. test_efuse_table_on_host_esp32s3:
  227. extends: .test_efuse_table_on_host_template
  228. variables:
  229. IDF_TARGET: esp32s3
  230. test_efuse_table_on_host_esp32c3:
  231. extends: .test_efuse_table_on_host_template
  232. variables:
  233. IDF_TARGET: esp32c3
  234. test_efuse_table_on_host_esp32h2:
  235. extends: .test_efuse_table_on_host_template
  236. variables:
  237. IDF_TARGET: esp32h2
  238. test_espcoredump:
  239. extends: .host_test_template
  240. artifacts:
  241. when: always
  242. paths:
  243. - components/espcoredump/test/**/.coverage
  244. - components/espcoredump/test/**/output
  245. expire_in: 1 week
  246. variables:
  247. IDF_COREDUMP_ELF_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/idf-coredump-elf.git"
  248. IDF_COREDUMP_ELF_TAG: idf-20210915
  249. # install CMake version specified in tools.json
  250. SETUP_TOOLS_LIST: "all"
  251. script:
  252. - eval $($IDF_PATH/tools/idf_tools.py export)
  253. - retry_failed git clone ${IDF_COREDUMP_ELF_REPO} -b $IDF_COREDUMP_ELF_TAG
  254. - cd ${IDF_PATH}/components/espcoredump/test/
  255. - ./test_espcoredump.sh ${CI_PROJECT_DIR}/idf-coredump-elf
  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. - ./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. - ./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. - ./test_mkdfu.py
  285. test_mkuf2:
  286. extends: .host_test_template
  287. script:
  288. - cd ${IDF_PATH}/tools/test_mkuf2
  289. - ./test_mkuf2.py
  290. test_autocomplete:
  291. extends:
  292. - .host_test_template
  293. artifacts:
  294. when: on_failure
  295. paths:
  296. - ${IDF_PATH}/*.out
  297. expire_in: 1 week
  298. script:
  299. - ${IDF_PATH}/tools/ci/test_autocomplete.py
  300. test_detect_python:
  301. extends:
  302. - .host_test_template
  303. script:
  304. - cd ${IDF_PATH}
  305. - shellcheck -s sh tools/detect_python.sh
  306. - shellcheck -s bash tools/detect_python.sh
  307. - shellcheck -s dash tools/detect_python.sh
  308. - "bash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  309. - "dash -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  310. - "zsh -c '. tools/detect_python.sh && echo Our Python: ${ESP_PYTHON?Python is not set}'"
  311. - "fish -c 'source tools/detect_python.fish && echo Our Python: $ESP_PYTHON'"
  312. test_split_path_by_spaces:
  313. extends: .host_test_template
  314. script:
  315. - cd ${IDF_PATH}/tools
  316. - python -m unittest split_paths_by_spaces.py
  317. test_nvs_page:
  318. extends: .host_test_template
  319. script:
  320. - cd ${IDF_PATH}/components/nvs_flash/host_test/nvs_page_test
  321. - idf.py build
  322. - build/test_nvs_page_host.elf
  323. test_mqtt_on_host:
  324. extends: .host_test_template
  325. script:
  326. - cd ${IDF_PATH}/components/mqtt/host_test
  327. - idf.py build
  328. - LSAN_OPTIONS=verbosity=1:log_threads=1 build/host_mqtt_client_test.elf
  329. test_log:
  330. extends: .host_test_template
  331. script:
  332. - cd ${IDF_PATH}/components/log/host_test/log_test
  333. - idf.py build
  334. - build/test_log_host.elf
  335. test_esp_event:
  336. extends: .host_test_template
  337. script:
  338. - cd ${IDF_PATH}/components/esp_event/host_test/esp_event_unit_test
  339. - idf.py build
  340. - build/test_esp_event_host.elf
  341. test_esp_timer_cxx:
  342. extends: .host_test_template
  343. script:
  344. - cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/esp_timer
  345. - idf.py build
  346. - build/test_esp_timer_cxx_host.elf
  347. test_eh_frame_parser:
  348. extends: .host_test_template
  349. script:
  350. - cd ${IDF_PATH}/components/esp_system/test_eh_frame_parser
  351. - make
  352. - ./eh_frame_test
  353. test_rom_on_linux_works:
  354. extends: .host_test_template
  355. script:
  356. - cd ${IDF_PATH}/components/esp_rom/host_test/rom_test
  357. - idf.py build
  358. - build/test_rom_host.elf
  359. test_cxx_gpio:
  360. extends: .host_test_template
  361. script:
  362. - cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/gpio
  363. - idf.py build
  364. - build/test_gpio_cxx_host.elf
  365. test_i2c_cxx:
  366. extends: .host_test_template
  367. script:
  368. - cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/i2c
  369. - idf.py build
  370. - build/test_i2c_cxx_host.elf
  371. test_spi_cxx:
  372. extends: .host_test_template
  373. script:
  374. - cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/spi
  375. - idf.py build
  376. - build/test_spi_cxx_host.elf
  377. test_system_cxx:
  378. extends: .host_test_template
  379. script:
  380. - cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/system
  381. - idf.py build
  382. - build/test_system_cxx_host.elf
  383. test_linux_example:
  384. extends: .host_test_template
  385. script:
  386. - cd ${IDF_PATH}/examples/build_system/cmake/linux_host_app
  387. - idf.py build
  388. - timeout 5 ./build/linux_host_app.elf >test.log || true
  389. - grep "Restarting" test.log
  390. test_partition_api_host:
  391. extends: .host_test_template
  392. script:
  393. - cd ${IDF_PATH}/components/spi_flash/host_test/partition_api_test
  394. - idf.py build
  395. - timeout 5 ./build/partition_api_test.elf >test.log
  396. - grep " 0 Failures" test.log
  397. test_gen_soc_caps_kconfig:
  398. extends: .host_test_template
  399. script:
  400. - cd ${IDF_PATH}/tools/gen_soc_caps_kconfig/
  401. - ./test/test_gen_soc_caps_kconfig.py
  402. test_pytest_qemu:
  403. extends:
  404. - .host_test_template
  405. - .before_script_build_jobs
  406. image: $QEMU_IMAGE
  407. artifacts:
  408. when: always
  409. paths:
  410. - XUNIT_RESULT.xml
  411. - pytest_embedded_log/
  412. reports:
  413. junit: XUNIT_RESULT.xml
  414. expire_in: 1 week
  415. script:
  416. - run_cmd python tools/ci/ci_build_apps.py . -vv
  417. --target esp32
  418. --pytest-apps
  419. -m qemu
  420. - pytest --target esp32 -m qemu --embedded-services idf,qemu --junitxml=XUNIT_RESULT.xml