2019-06-28 12:39:21 -04:00
|
|
|
assign_test:
|
|
|
|
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 14:55:11 -04:00
|
|
|
# we have a lot build example jobs. now we don't use dependencies, just download all artifacts of build stage.
|
2019-06-28 12:39:21 -04:00
|
|
|
dependencies:
|
2019-12-19 21:52:33 -05:00
|
|
|
- build_ssc_esp32
|
2020-04-28 22:38:05 -04:00
|
|
|
- build_esp_idf_tests_cmake_esp32
|
|
|
|
- build_esp_idf_tests_cmake_esp32s2
|
2019-06-28 12:39:21 -04:00
|
|
|
variables:
|
2019-11-28 04:08:25 -05:00
|
|
|
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
|
2019-06-28 12:39:21 -04:00
|
|
|
EXAMPLE_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/examples/test_configs"
|
2019-10-20 14:55:11 -04:00
|
|
|
TEST_APP_CONFIG_OUTPUT_PATH: "$CI_PROJECT_DIR/tools/test_apps/test_configs"
|
2020-04-28 22:38:05 -04:00
|
|
|
UNIT_TEST_CASE_FILE: "${CI_PROJECT_DIR}/components/idf_test/unit_test"
|
2020-10-23 21:24:38 -04:00
|
|
|
INTEGRATION_CONFIG_OUTPUT_PATH: "${CI_PROJECT_DIR}/components/idf_test/integration_test/CIConfigs"
|
|
|
|
PYTHON_VER: 3.7.7
|
2019-06-28 12:39:21 -04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- components/idf_test/*/CIConfigs
|
|
|
|
- $EXAMPLE_CONFIG_OUTPUT_PATH
|
2019-10-20 14:55:11 -04:00
|
|
|
- $TEST_APP_CONFIG_OUTPUT_PATH
|
2019-11-26 22:58:07 -05:00
|
|
|
- build_examples/artifact_index.json
|
2020-01-27 06:12:49 -05:00
|
|
|
- build_test_apps/artifact_index.json
|
2019-06-28 12:39:21 -04:00
|
|
|
expire_in: 1 week
|
|
|
|
only:
|
|
|
|
variables:
|
|
|
|
- $BOT_TRIGGER_WITH_LABEL == null
|
|
|
|
- $BOT_LABEL_UNIT_TEST
|
2020-03-04 22:10:49 -05:00
|
|
|
- $BOT_LABEL_UNIT_TEST_S2
|
2019-06-28 12:39:21 -04:00
|
|
|
- $BOT_LABEL_INTEGRATION_TEST
|
|
|
|
- $BOT_LABEL_EXAMPLE_TEST
|
2020-01-27 06:12:49 -05:00
|
|
|
- $BOT_LABEL_CUSTOM_TEST
|
2019-06-28 12:39:21 -04:00
|
|
|
script:
|
|
|
|
# assign example tests
|
2019-11-26 22:58:07 -05:00
|
|
|
- python tools/ci/python_packages/ttfw_idf/CIAssignExampleTest.py $IDF_PATH/examples $CI_TARGET_TEST_CONFIG_FILE $EXAMPLE_CONFIG_OUTPUT_PATH
|
2019-10-20 14:55:11 -04:00
|
|
|
# assign test apps
|
2020-01-27 06:12:49 -05:00
|
|
|
- python tools/ci/python_packages/ttfw_idf/CIAssignExampleTest.py --custom-group test-apps --job-prefix test_app_test_ $IDF_PATH/tools/test_apps $CI_TARGET_TEST_CONFIG_FILE $TEST_APP_CONFIG_OUTPUT_PATH
|
2019-06-28 12:39:21 -04:00
|
|
|
# assign unit test cases
|
2019-11-26 22:58:07 -05:00
|
|
|
- python tools/ci/python_packages/ttfw_idf/CIAssignUnitTest.py $UNIT_TEST_CASE_FILE $CI_TARGET_TEST_CONFIG_FILE $IDF_PATH/components/idf_test/unit_test/CIConfigs
|
2019-06-28 12:39:21 -04:00
|
|
|
# clone test script to assign tests
|
2020-10-23 21:24:38 -04:00
|
|
|
- git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
|
|
|
|
- ./tools/ci/retry_failed.sh git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
|
2019-06-28 12:39:21 -04:00
|
|
|
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
|
2020-10-23 21:24:38 -04:00
|
|
|
- export PYTHONPATH="${CI_PROJECT_DIR}/auto_test_script/packages:$PYTHONPATH"
|
2019-06-28 12:39:21 -04:00
|
|
|
- cd auto_test_script
|
2020-10-23 21:24:38 -04:00
|
|
|
# assign integration test cases
|
|
|
|
- python bin/CIAssignTestCases.py -t TestCaseFiles/ -c $CI_TARGET_TEST_CONFIG_FILE -b $IDF_PATH/SSC/ssc_bin -o $INTEGRATION_CONFIG_OUTPUT_PATH
|
2019-06-28 12:39:21 -04:00
|
|
|
|
|
|
|
update_test_cases:
|
|
|
|
stage: assign_test
|
|
|
|
image: $CI_DOCKER_REGISTRY/ubuntu-test-env
|
|
|
|
tags:
|
|
|
|
- deploy_test
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- master
|
|
|
|
- schedules
|
|
|
|
dependencies:
|
2020-04-28 22:38:05 -04:00
|
|
|
- build_esp_idf_tests_cmake_esp32
|
|
|
|
- build_esp_idf_tests_cmake_esp32s2
|
2019-06-28 12:39:21 -04:00
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- ${CI_PROJECT_DIR}/test-management/*.log
|
|
|
|
expire_in: 1 week
|
|
|
|
variables:
|
2019-11-28 04:08:25 -05:00
|
|
|
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
|
2020-04-28 22:38:05 -04:00
|
|
|
UNIT_TEST_CASE_DIR: "${CI_PROJECT_DIR}/components/idf_test/unit_test"
|
2019-06-28 12:39:21 -04: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-23 21:24:38 -04:00
|
|
|
PYTHON_VER: 3.7.7
|
2019-06-28 12:39:21 -04:00
|
|
|
script:
|
|
|
|
- export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
|
|
|
|
- git clone $TEST_MANAGEMENT_REPO
|
|
|
|
- python $CHECKOUT_REF_SCRIPT test-management test-management
|
|
|
|
- cd test-management
|
|
|
|
- echo $BOT_JIRA_ACCOUNT > ${BOT_ACCOUNT_CONFIG_FILE}
|
|
|
|
# update unit test cases
|
2020-04-28 22:38:05 -04:00
|
|
|
- export UNIT_TEST_CASE_FILES=$(find $UNIT_TEST_CASE_DIR -maxdepth 1 -name "*.yml" | xargs)
|
|
|
|
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT unity -d $UNIT_TEST_CASE_FILES -r $GIT_SHA
|
2019-06-28 12:39:21 -04:00
|
|
|
# update example test cases
|
|
|
|
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT tiny_test_fw -d ${CI_PROJECT_DIR}/examples -r $GIT_SHA
|
|
|
|
# organize test cases
|
|
|
|
- python OrganizeTestCases.py $JIRA_TEST_MANAGEMENT_PROJECT
|