]> granicus.if.org Git - esp-idf/blobdiff - .gitlab-ci.yml
Panic handler: Use same reset path as esp_restart(), disabling hardware
[esp-idf] / .gitlab-ci.yml
index 814279ce159ac46a984875a9a3f4b683f0a25894..8cb5c8bcac53c11bfa5714583300d0e740e43fa2 100644 (file)
@@ -14,9 +14,10 @@ before_script:
   - chmod 600 ~/.ssh/id_rsa
   - echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
 
-  # if testing master branch, use github wifi libs.
-  # if testing other branches, use gitlab wifi libs (as maybe changes aren't merged to master yet)
-  - test "${CI_BUILD_REF_NAME}" = "master" || sed -i "s%https://github.com/espressif/esp32-wifi-lib%ssh://git@gitlab.espressif.cn:27227/idf/esp32-wifi-lib%" .gitmodules
+  # if testing master branch, use github wifi and bt libs.
+  # if testing other branches, use gitlab wifi and bt libs (as maybe changes aren't merged to master yet)
+  - test "${CI_BUILD_REF_NAME}" = "master" || sed -i "s%https://github.com/espressif/esp32-wifi-lib%${GITLAB_SSH_SERVER}/idf/esp32-wifi-lib%" .gitmodules
+  - test "${CI_BUILD_REF_NAME}" = "master" || sed -i "s%https://github.com/espressif/esp32-bt-lib%${GITLAB_SSH_SERVER}/idf/esp32-bt-lib%" .gitmodules
   # fetch all submodules
   - git submodule update --init --recursive
 
@@ -46,6 +47,10 @@ build_template_app:
     - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig
     - make defconfig
     - make all V=1
+    # Check if there are any stray printf/ets_printf references in WiFi libs
+    - cd ../components/esp32/lib
+    - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
+    - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
 
 
 .build_gitlab: &build_template
@@ -78,18 +83,17 @@ build_esp_idf_tests:
   <<: *build_template
   artifacts:
     paths:
-      - ./esp-idf-tests/build/*.bin
-      - ./esp-idf-tests/build/*.elf
-      - ./esp-idf-tests/build/*.map
-      - ./esp-idf-tests/build/bootloader/*.bin
+      - ./tools/unit-test-app/build/*.bin
+      - ./tools/unit-test-app/build/*.elf
+      - ./tools/unit-test-app/build/*.map
+      - ./tools/unit-test-app/build/bootloader/*.bin
     expire_in: 6 mos
 
   script:
-    - git clone $GITLAB_SSH_SERVER/idf/esp-idf-tests.git
-    - cd esp-idf-tests
+    - cd tools/unit-test-app
     - git checkout ${CI_BUILD_REF_NAME} || echo "Using default branch..."
     - make defconfig
-    - make
+    - make TESTS_ALL=1
 
 build_examples:
   <<: *build_template
@@ -131,7 +135,7 @@ test_nvs_on_host:
   tags:
     - nvs_host_test
   script:
-    - cd components/nvs_flash/test
+    - cd components/nvs_flash/test_nvs_host
     - make test
 
 test_build_system:
@@ -146,11 +150,12 @@ test_build_system:
 
 test_report:
   stage: test_report
+  image: espressif/esp32-ci-env
   only:
     - master
     - triggers
   tags:
-    - test_report
+    - report
   variables:
     LOG_PATH: "$CI_PROJECT_DIR/$CI_BUILD_REF"
     TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test"
@@ -162,12 +167,34 @@ test_report:
       - $LOG_PATH
     expire_in: 12 mos
   script:
+    # calc log path
+    - VER_NUM=`git rev-list HEAD | wc -l | awk '{print $1}'`
+    - SHA_ID=`echo $CI_BUILD_REF | cut -c 1-7`
+    - REVISION="${VER_NUM}_${SHA_ID}"
+    # replace / to _ in branch name
+    - ESCAPED_BRANCH_NAME=`echo $CI_BUILD_REF_NAME | sed 's/\//___/g'`
+    # result path and artifacts path
+    - RESULT_PATH="$CI_PROJECT_NAME/$ESCAPED_BRANCH_NAME/$REVISION"
+    - ARTIFACTS_PATH="$GITLAB_HTTP_SERVER/idf/esp-idf/builds/$CI_BUILD_ID/artifacts/browse/$CI_BUILD_REF"
     # clone test bench
     - git clone $GITLAB_SSH_SERVER/yinling/auto_test_script.git
     - cd auto_test_script
     # generate report
-    - python CITestReport.py -l $LOG_PATH -t $TEST_CASE_FILE_PATH -p $REPORT_PATH
-
+    - TEST_RESULT=Pass
+    - python CITestReport.py -l $LOG_PATH -t $TEST_CASE_FILE_PATH -p $REPORT_PATH -r $RESULT_PATH -a $ARTIFACTS_PATH || TEST_RESULT=Fail
+    # commit to CI-test-result project
+    - git clone $GITLAB_SSH_SERVER/qa/CI-test-result.git
+    - rm -rf CI-test-result/RawData/$RESULT_PATH
+    - cp -R $CI_PROJECT_NAME CI-test-result/RawData
+    - cd CI-test-result
+    # config git user
+    - git config --global user.email "ci-test-result@espressif.com"
+    - git config --global user.name "ci-test-result"
+    # commit test result
+    - git add .
+    - git commit . -m "update test result for $CI_PROJECT_NAME/$CI_BUILD_REF_NAME/$CI_BUILD_REF, pipeline ID $CI_PIPELINE_ID" || exit 0
+    - git push origin master
+    - test "${TEST_RESULT}" = "Pass" || exit 1
 
 push_master_to_github:
   before_script:
@@ -244,6 +271,8 @@ deploy_docs:
     expire_in: 6 mos
 
   script:
+    # remove artifacts from last stage (UT logs)
+    - rm -rf $LOG_PATH
     # add gitlab ssh key
     - mkdir -p ~/.ssh
     - chmod 700 ~/.ssh
@@ -265,6 +294,8 @@ deploy_docs:
     # can only be triggered
     - triggers
   script:
+    # remove artifacts from last stage (UT logs)
+    - rm -rf $LOG_PATH
     # must be night build triggers, otherwise exit without test
     - test $NIGHT_BUILD = "Yes" || exit 0
     # add gitlab ssh key
@@ -289,7 +320,7 @@ deploy_docs:
   variables:
     # jobs MUST set CONFIG_FILE in before_script, and overwrite the variables above if necessary
     LOCAL_ENV_CONFIG_PATH: /home/gitlab-runner/LocalConfig/ESP32_IDF
-    BIN_PATH: "$CI_PROJECT_DIR/esp-idf-tests/build/"
+    BIN_PATH: "$CI_PROJECT_DIR/tools/unit-test-app/build/"
     LOG_PATH: "$CI_PROJECT_DIR/$CI_BUILD_REF"
     APP_NAME: "ut"
     TEST_CASE_FILE_PATH: "$CI_PROJECT_DIR/components/idf_test/unit_test"
@@ -342,7 +373,6 @@ IT_Function_TCPIP_02:
   tags:
     - ESP32_IDF
     - SSC_T1_1
-    - SSC_T2_1
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_02.yml
 
@@ -369,10 +399,73 @@ IT_Function_TCPIP_05:
   tags:
     - ESP32_IDF
     - SSC_T1_1
-    - SSC_T2_1
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_05.yml
 
+IT_Stress_WIFI_01:
+  <<: *test_template_night
+  tags:
+    - ESP32_IDF
+    - SSC_T5_1
+  before_script:
+    - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Stress_WIFI_01.yml
+
+IT_Stress_TCPIP_01:
+  <<: *test_template_night
+  tags:
+    - ESP32_IDF
+    - SSC_T1_1
+  before_script:
+    - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Stress_TCPIP_01.yml
+
+IT_Stress_TCPIP_02:
+  <<: *test_template_night
+  tags:
+    - ESP32_IDF
+    - SSC_T2_1
+  before_script:
+    - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Stress_TCPIP_02.yml
+
+IT_Stress_TCPIP_03:
+  <<: *test_template_night
+  tags:
+    - ESP32_IDF
+    - SSC_T1_1
+  before_script:
+    - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Stress_TCPIP_03.yml
+
+IT_Stress_TCPIP_04:
+  <<: *test_template_night
+  tags:
+    - ESP32_IDF
+    - SSC_T2_1
+  before_script:
+    - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Stress_TCPIP_04.yml
+
+IT_Stable_TCPIP_01:
+  <<: *test_template_night
+  tags:
+    - ESP32_IDF
+    - SSC_T5_1
+  before_script:
+    - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Stable_TCPIP_01.yml
+
+IT_Stable_TCPIP_02:
+  <<: *test_template_night
+  tags:
+    - ESP32_IDF
+    - SSC_T1_1
+  before_script:
+    - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Stable_TCPIP_02.yml
+
+IT_Stable_TCPIP_03:
+  <<: *test_template_night
+  tags:
+    - ESP32_IDF
+    - SSC_T5_1
+  before_script:
+    - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Stable_TCPIP_03.yml
+
 IT_Function_TCPIP_06:
   <<: *test_template_night
   tags:
@@ -385,7 +478,7 @@ IT_Function_WIFI_03:
   <<: *test_template
   tags:
     - ESP32_IDF
-    - SSC_T3_PhyMode
+    - SSC_T1_APC
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_03.yml
 
@@ -393,7 +486,7 @@ IT_Function_WIFI_04:
   <<: *test_template
   tags:
     - ESP32_IDF
-    - SSC_T1_APC
+    - SSC_T3_PhyMode
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_WIFI_04.yml
 
@@ -419,7 +512,6 @@ IT_Function_TCPIP_07:
     - ESP32_IDF
     - SSC_T1_1
     - SSC_T1_2
-    - SSC_T2_1
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_07.yml
 
@@ -428,6 +520,7 @@ IT_Function_TCPIP_08:
   tags:
     - ESP32_IDF
     - SSC_T1_1
+    - SSC_T2_1
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_08.yml
 
@@ -436,6 +529,7 @@ IT_Function_TCPIP_09:
   tags:
     - ESP32_IDF
     - SSC_T1_1
+    - SSC_T1_2
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_09.yml
 
@@ -445,7 +539,6 @@ IT_Function_TCPIP_10:
     - ESP32_IDF
     - SSC_T1_1
     - SSC_T1_2
-    - SSC_T2_1
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_10.yml
 
@@ -454,7 +547,6 @@ IT_Function_TCPIP_11:
   tags:
     - ESP32_IDF
     - SSC_T1_1
-    - SSC_T1_2
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_11.yml
 
@@ -465,3 +557,4 @@ IT_Function_TCPIP_12:
     - SSC_T1_1
   before_script:
     - CONFIG_FILE=$TEST_CASE_FILE_PATH/CIConfigs/IT_Function_TCPIP_12.yml
+