Skip to content

Commit 0478edc

Browse files
committed
CI: download only required bin for unit-tests. Refactor AssignTest related code
1 parent 59347d6 commit 0478edc

File tree

9 files changed

+264
-261
lines changed

9 files changed

+264
-261
lines changed

tools/ci/config/assign-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ assign_test:
2424
- $TEST_APP_CONFIG_OUTPUT_PATH
2525
- build_examples/artifact_index.json
2626
- build_test_apps/artifact_index.json
27+
- tools/unit-test-app/builds/artifact_index.json
2728
expire_in: 1 week
2829
only:
2930
variables:
@@ -35,11 +36,11 @@ assign_test:
3536
- $BOT_LABEL_CUSTOM_TEST
3637
script:
3738
# assign example tests
38-
- python tools/ci/python_packages/ttfw_idf/CIAssignExampleTest.py $IDF_PATH/examples $CI_TARGET_TEST_CONFIG_FILE $EXAMPLE_CONFIG_OUTPUT_PATH
39+
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py example_test $IDF_PATH/examples $CI_TARGET_TEST_CONFIG_FILE $EXAMPLE_CONFIG_OUTPUT_PATH
3940
# assign test apps
40-
- 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
41+
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py custom_test $IDF_PATH/tools/test_apps $CI_TARGET_TEST_CONFIG_FILE $TEST_APP_CONFIG_OUTPUT_PATH
4142
# assign unit test cases
42-
- 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
43+
- python tools/ci/python_packages/ttfw_idf/IDFAssignTest.py unit_test $UNIT_TEST_CASE_FILE $CI_TARGET_TEST_CONFIG_FILE $IDF_PATH/components/idf_test/unit_test/CIConfigs
4344
# clone test script to assign tests
4445
- ./tools/ci/retry_failed.sh git clone $TEST_SCRIPT_REPOSITORY
4546
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script

tools/ci/config/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ build_ssc_esp32s2:
4545
artifacts:
4646
paths:
4747
- tools/unit-test-app/output/${IDF_TARGET}
48-
- tools/unit-test-app/builds/${IDF_TARGET}/*.json
48+
- tools/unit-test-app/builds/*.json
4949
- tools/unit-test-app/builds/${IDF_TARGET}/*/size.json
5050
- components/idf_test/unit_test/*.yml
5151
- $LOG_PATH

tools/ci/config/target-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
stage: target_test
110110
dependencies:
111111
- assign_test
112-
- build_esp_idf_tests_cmake_esp32
113112
only:
114113
refs:
115114
- master
@@ -546,7 +545,6 @@ UT_034:
546545
extends: .unit_test_template
547546
dependencies:
548547
- assign_test
549-
- build_esp_idf_tests_cmake_esp32s2
550548
only:
551549
refs:
552550
# Due to lack of runners, the tests are only done by manual trigger

tools/ci/find_apps_build_apps.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,7 @@ if [ "${TEST_TYPE}" = "unit_test" ]; then
169169
mkdir -p ${dst}/partition_table
170170
cp ${src}/partition_table/*.bin ${dst}/partition_table/
171171
done
172+
173+
# Copy app list json files to build path
174+
mv ${BUILD_PATH}/${IDF_TARGET}/*.json ${BUILD_PATH}
172175
fi

tools/ci/python_packages/gitlab_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def download_artifact(self, job_id, artifact_path, destination=None):
109109
try:
110110
data = job.artifact(a_path)
111111
except gitlab.GitlabGetError as e:
112-
print("Failed to download '{}' form job {}".format(a_path, job_id))
112+
print("Failed to download '{}' from job {}".format(a_path, job_id))
113113
raise e
114114
raw_data_list.append(data)
115115
if destination:

tools/ci/python_packages/ttfw_idf/CIAssignExampleTest.py

Lines changed: 0 additions & 114 deletions
This file was deleted.

tools/ci/python_packages/ttfw_idf/CIScanTests.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
import json
44
import logging
55
import os
6-
import re
76
from collections import defaultdict
87

98
from find_apps import find_apps
109
from find_build_apps import BUILD_SYSTEMS, BUILD_SYSTEM_CMAKE
11-
from ttfw_idf.CIAssignExampleTest import CIExampleAssignTest, TestAppsGroup, ExampleGroup
10+
from ttfw_idf.IDFAssignTest import ExampleAssignTest, TestAppsAssignTest
1211

1312
VALID_TARGETS = [
1413
'esp32',
@@ -98,10 +97,9 @@ def main():
9897
test_cases = []
9998
for path in set(args.paths):
10099
if args.test_type == 'example_test':
101-
assign = CIExampleAssignTest(path, args.ci_config_file, ExampleGroup)
100+
assign = ExampleAssignTest(path, args.ci_config_file)
102101
elif args.test_type == 'test_apps':
103-
CIExampleAssignTest.CI_TEST_JOB_PATTERN = re.compile(r'^test_app_test_.+')
104-
assign = CIExampleAssignTest(path, args.ci_config_file, TestAppsGroup)
102+
assign = TestAppsAssignTest(path, args.ci_config_file)
105103
else:
106104
raise SystemExit(1) # which is impossible
107105

0 commit comments

Comments
 (0)