esp-idf/tools/ci/config/assign-test.yml

92 lines
4.5 KiB
YAML
Raw Normal View History

assign_test:
extends:
2020-10-27 01:52:08 -04:00
- .rules:assign_test:target_test-integration_test-weekend_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.
# we have a lot build example jobs. now we don't use dependencies, just download all artifacts of build stage.
dependencies: # Here is not a hard dependency relationship, could be skipped. so we do not use "needs" here.
- build_ssc_esp32
2022-02-10 07:21:55 -05:00
- build_ssc_esp32c3
- build_esp_idf_tests_cmake_esp32
- build_esp_idf_tests_cmake_esp32s2
- build_esp_idf_tests_cmake_esp32c3
variables:
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
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"
2022-02-10 08:13:37 -05:00
INTEGRATION_TEST_DIR: "${CI_PROJECT_DIR}/tools/ci/integration_test"
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-10 22:31:17 -05:00
# auto_test_script only supports python 3.7.x
PYTHON_VER: 3.7.7
2022-09-13 14:43:40 -04:00
GIT_LFS_SKIP_SMUDGE: 1
artifacts:
paths:
- components/idf_test/*/CIConfigs
- $EXAMPLE_TEST_DIR/test_configs
- $CUSTOM_TEST_DIR/test_configs
- $COMPONENT_UT_OUTPUT_DIR/test_configs
2022-02-10 08:13:37 -05:00
- $INTEGRATION_TEST_DIR/test_configs
- build_examples/artifact_index.json
- build_test_apps/artifact_index.json
- build_component_ut/artifact_index.json
- tools/unit-test-app/builds/artifact_index.json
expire_in: 1 week
script:
- 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
# clone test script to assign tests
2022-09-13 14:43:40 -04:00
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# assign integration test cases
2022-09-13 14:43:40 -04:00
- cd ${CI_PROJECT_DIR}
2022-02-10 08:13:37 -05: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_TEST_DIR/test_configs
update_test_cases:
extends: .rules:ref:master-schedule
stage: assign_test
image: $CI_DOCKER_REGISTRY/ubuntu-test-env
tags:
- deploy_test
needs:
- build_esp_idf_tests_cmake_esp32
- build_esp_idf_tests_cmake_esp32s2
- build_esp_idf_tests_cmake_esp32c3
artifacts:
when: always
paths:
- ${CI_PROJECT_DIR}/test-management/*.log
expire_in: 1 week
variables:
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
UNIT_TEST_DIR: "${CI_PROJECT_DIR}/components/idf_test/unit_test"
BOT_ACCOUNT_CONFIG_FILE: "${CI_PROJECT_DIR}/test-management/Config/Account.local.yml"
AUTO_TEST_SCRIPT_PATH: "${CI_PROJECT_DIR}/auto_test_script"
PYTHON_VER: 3.7.7
script:
- export GIT_SHA=$(echo ${CI_COMMIT_SHA} | cut -c 1-8)
- retry_failed 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
- export UNIT_TEST_CASE_FILES=$(find $UNIT_TEST_DIR -maxdepth 1 -name "*.yml" | xargs)
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT unity -d $UNIT_TEST_CASE_FILES -r $GIT_SHA
# 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 08:09:19 -04:00
- python ImportTestCase.py $JIRA_TEST_MANAGEMENT_PROJECT tiny_test_fw -d ${CI_PROJECT_DIR}/tools/test_apps -r $GIT_SHA
# organize test cases
- python OrganizeTestCases.py $JIRA_TEST_MANAGEMENT_PROJECT