Skip to content

Commit 20cbdea

Browse files
committed
Merge branch 'feature/download_only_required_ut_bin' into 'master'
CI: Download only required bin for unit tests Closes IDF-1608 See merge request espressif/esp-idf!9266
2 parents 066361f + 19ad15a commit 20cbdea

File tree

13 files changed

+272
-273
lines changed

13 files changed

+272
-273
lines changed

examples/system/app_trace_to_host/example_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
@ttfw_idf.idf_example_test(env_tag="test_jtag_arm")
88
def test_examples_app_trace_to_host(env, extra_data):
9-
109
rel_project_path = os.path.join('examples', 'system', 'app_trace_to_host')
1110
dut = env.get_dut('app_trace_to_host', rel_project_path)
1211
idf_path = dut.app.get_sdk_path()
@@ -28,8 +27,7 @@ def test_examples_app_trace_to_host(env, extra_data):
2827

2928
with ttfw_idf.CustomProcess(' '.join([os.path.join(idf_path, 'tools/esp_app_trace/logtrace_proc.py'),
3029
'adc.log',
31-
os.path.join(dut.app.get_binary_path(rel_project_path),
32-
'app_trace_to_host.elf')]),
30+
os.path.join(dut.app.binary_path, 'app_trace_to_host.elf')]),
3331
logfile='logtrace_proc.log') as logtrace:
3432
logtrace.pexpect_proc.expect_exact('Parse trace file')
3533
logtrace.pexpect_proc.expect_exact('Parsing completed.')

examples/system/sysview_tracing/example_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ def test_examples_sysview_tracing(env, extra_data):
1313

1414
rel_project_path = os.path.join('examples', 'system', 'sysview_tracing')
1515
dut = env.get_dut('sysview_tracing', rel_project_path)
16-
idf_path = dut.app.get_sdk_path()
17-
proj_path = os.path.join(idf_path, rel_project_path)
18-
elf_path = os.path.join(dut.app.get_binary_path(rel_project_path), 'sysview_tracing.elf')
16+
proj_path = os.path.join(dut.app.idf_path, rel_project_path)
17+
elf_path = os.path.join(dut.app.binary_path, 'sysview_tracing.elf')
1918

2019
def get_temp_file():
2120
with tempfile.NamedTemporaryFile(delete=False) as f:

examples/system/sysview_tracing_heap_log/example_test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ def test_examples_sysview_tracing_heap_log(env, extra_data):
1212

1313
rel_project_path = os.path.join('examples', 'system', 'sysview_tracing_heap_log')
1414
dut = env.get_dut('sysview_tracing_heap_log', rel_project_path)
15-
idf_path = dut.app.get_sdk_path()
16-
proj_path = os.path.join(idf_path, rel_project_path)
17-
elf_path = os.path.join(dut.app.get_binary_path(rel_project_path), 'sysview_tracing_heap_log.elf')
15+
proj_path = os.path.join(dut.app.idf_path, rel_project_path)
16+
elf_path = os.path.join(dut.app.binary_path, 'sysview_tracing_heap_log.elf')
1817

1918
def get_temp_file():
2019
with tempfile.NamedTemporaryFile(delete=False) as f:
@@ -45,7 +44,7 @@ def get_temp_file():
4544
# dut has been restarted by gdb since the last dut.expect()
4645
dut.expect('esp_apptrace: Initialized TRAX on CPU0')
4746

48-
with ttfw_idf.CustomProcess(' '.join([os.path.join(idf_path, 'tools/esp_app_trace/sysviewtrace_proc.py'),
47+
with ttfw_idf.CustomProcess(' '.join([os.path.join(dut.app.idf_path, 'tools/esp_app_trace/sysviewtrace_proc.py'),
4948
'-p',
5049
'-b', elf_path,
5150
tempfiles[1]]),

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)