2019-06-28 16:39:21 +00:00
|
|
|
assign_test:
|
2021-02-09 04:31:38 +00:00
|
|
|
extends: .rules:test:any_test
|
2019-06-28 16:39:21 +00:00
|
|
|
tags:
|
|
|
|
- assign_test
|
|
|
|
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG
|
|
|
|
stage: assign_test
|
|
|
|
# gitlab ci do not support match job with RegEx or wildcard now in dependencies.
|
2019-10-20 18:55:11 +00:00
|
|
|
# we have a lot build example jobs. now we don't use dependencies, just download all artifacts of build stage.
|
2020-09-27 03:20:53 +00:00
|
|
|
dependencies: # Here is not a hard dependency relationship, could be skipped. so we do not use "needs" here.
|
2019-12-20 02:52:33 +00:00
|
|
|
- build_ssc_esp32
|
2020-04-29 02:38:05 +00:00
|
|
|
- build_esp_idf_tests_cmake_esp32
|
|
|
|
- build_esp_idf_tests_cmake_esp32s2
|
2021-06-07 10:17:13 +00:00
|
|
|
- build_esp_idf_tests_cmake_esp32s3
|
2020-12-30 08:10:37 +00:00
|
|
|
- build_esp_idf_tests_cmake_esp32c3
|
2019-06-28 16:39:21 +00:00
|
|
|
variables:
|
2019-11-28 09:08:25 +00:00
|
|
|
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
|
2020-09-27 03:20:53 +00:00
|
|
|
EXAMPLE_TEST_DIR: "${CI_PROJECT_DIR}/examples"
|
|
|
|
CUSTOM_TEST_DIR: "${CI_PROJECT_DIR}/tools/test_apps"
|
|
|
|
UNIT_TEST_DIR: "${CI_PROJECT_DIR}/components/idf_test/unit_test"
|
|
|
|
# COMPONENT_UT_DIRS is set by `set_component_ut_vars` in `utils.sh`
|
|
|
|
COMPONENT_UT_OUTPUT_DIR: "${CI_PROJECT_DIR}/component_ut"
|
2020-10-24 01:21:17 +00:00
|
|
|
INTEGRATION_CONFIG_OUTPUT_PATH: "${CI_PROJECT_DIR}/components/idf_test/integration_test/CIConfigs"
|
|
|
|
INTEGRATION_TEST_CASE_PATH: "${CI_PROJECT_DIR}/auto_test_script/TestCaseFiles"
|
|
|
|
ASSIGN_TEST_CASE_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIAssignTestCases.py"
|
|
|
|
PYTHONPATH: ${CI_PROJECT_DIR}/auto_test_script/packages
|
2020-11-11 03:31:17 +00:00
|
|
|
# auto_test_script only supports python 3.7.x
|
2020-10-24 01:21:17 +00:00
|
|
|
PYTHON_VER: 3.7.7
|
2019-06-28 16:39:21 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- components/idf_test/*/CIConfigs
|
2020-11-04 08:48:30 +00:00
|
|
|
- $EXAMPLE_TEST_DIR/test_configs
|
|
|
|
- $CUSTOM_TEST_DIR/test_configs
|
|
|
|
- $COMPONENT_UT_OUTPUT_DIR/test_configs
|
2019-11-27 03:58:07 +00:00
|
|
|
- build_examples/artifact_index.json
|
2020-01-27 11:12:49 +00:00
|
|
|
- build_test_apps/artifact_index.json
|
2020-08-25 08:42:36 +00:00
|
|
|
- build_component_ut/artifact_index.json
|
2020-07-21 08:59:31 +00:00
|
|
|
- tools/unit-test-app/builds/artifact_index.json
|
2019-06-28 16:39:21 +00:00
|
|
|
expire_in: 1 week
|
|
|
|
script:
|
2020-09-27 03:20:53 +00:00
|
|
|
- set_component_ut_vars
|
|
|
|
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py example_test $EXAMPLE_TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $EXAMPLE_TEST_DIR/test_configs
|
|
|
|
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py custom_test $CUSTOM_TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $CUSTOM_TEST_DIR/test_configs
|
|
|
|
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py component_ut $COMPONENT_UT_DIRS -c $CI_TARGET_TEST_CONFIG_FILE -o $COMPONENT_UT_OUTPUT_DIR/test_configs
|
|
|
|
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py unit_test $UNIT_TEST_DIR -c $CI_TARGET_TEST_CONFIG_FILE -o $UNIT_TEST_DIR/CIConfigs
|
2019-06-28 16:39:21 +00:00
|
|
|
# clone test script to assign tests
|
2020-10-24 01:21:17 +00:00
|
|
|
# can not retry if downing git lfs files failed, so using empty_branch first.
|
2020-09-27 03:20:53 +00:00
|
|
|
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
|
|
|
|
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
|
2020-10-30 06:39:42 +00:00
|
|
|
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
|
2020-08-25 08:42:36 +00:00
|
|
|
# assign integration test cases
|
2020-10-24 01:21:17 +00:00
|
|
|
- python ${ASSIGN_TEST_CASE_SCRIPT} -t ${INTEGRATION_TEST_CASE_PATH} -c $CI_TARGET_TEST_CONFIG_FILE -b $IDF_PATH/SSC/ssc_bin -o $INTEGRATION_CONFIG_OUTPUT_PATH
|
2019-06-28 16:39:21 +00:00
|
|
|
|
|
|
|
update_test_cases:
|
2020-10-20 07:00:50 +00:00
|
|
|
extends: .rules:ref:master-schedule
|
2019-06-28 16:39:21 +00:00
|
|
|
stage: assign_test
|
|
|
|
image: $CI_DOCKER_REGISTRY/ubuntu-test-env
|
|
|
|
tags:
|
|
|
|
- deploy_test
|
2020-09-27 03:20:53 +00:00
|
|
|
needs:
|
2020-04-29 02:38:05 +00:00
|
|
|
- build_esp_idf_tests_cmake_esp32
|
|
|
|
- build_esp_idf_tests_cmake_esp32s2
|
2021-06-07 10:17:13 +00:00
|
|
|
- build_esp_idf_tests_cmake_esp32s3
|
2020-12-30 08:10:37 +00:00
|
|
|
- build_esp_idf_tests_cmake_esp32c3
|
2019-06-28 16:39:21 +00:00
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- ${CI_PROJECT_DIR}/test-management/*.log
|
|
|
|
expire_in: 1 week
|
|
|
|
variables:
|
2019-11-28 09:08:25 +00:00
|
|
|
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
|
2020-09-27 03:20:53 +00:00
|
|
|
UNIT_TEST_DIR: "${CI_PROJECT_DIR}/components/idf_test/unit_test"
|
2019-06-28 16:39:21 +00:00
|
|
|
BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
|
|
|
|
AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
|
2020-10-24 01:21:17 +00:00
|
|
|
PYTHON_VER: 3.7.7
|
2019-06-28 16:39:21 +00:00
|
|
|
script:
|
|
|
|
- export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
|
2020-09-28 06:27:10 +00:00
|
|
|
- retry_failed git clone $TEST_MANAGEMENT_REPO
|
2019-06-28 16:39:21 +00:00
|
|
|
- python $CHECKOUT_REF_SCRIPT test-management test-management
|
|
|
|
- cd test-management
|
|
|
|
- echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
|
|
|
|
# update unit test cases
|
2020-09-27 03:20:53 +00:00
|
|
|
- export UNIT_TEST_CASE_FILES=$(find $UNIT_TEST_DIR -maxdepth 1 -name "*.yml" | xargs)
|
2020-04-29 02:38:05 +00:00
|
|
|
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT unity -d $UNIT_TEST_CASE_FILES -r $GIT_SHA
|
2019-06-28 16:39:21 +00:00
|
|
|
# update example test cases
|
|
|
|
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT tiny_test_fw -d ${CI_PROJECT_DIR}/examples -r $GIT_SHA
|
2020-07-20 12:09:19 +00:00
|
|
|
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT tiny_test_fw -d ${CI_PROJECT_DIR}/tools/test_apps -r $GIT_SHA
|
2019-06-28 16:39:21 +00:00
|
|
|
# organize test cases
|
|
|
|
- python OrganizeTestCases.py $JIRA_TEST_MANAGEMENT_PROJECT
|