ci: add xtal_40mhz tag for c2 tests

This commit is contained in:
laokaiyao 2022-07-19 14:19:44 +08:00 committed by Kevin (Lao Kaiyao)
parent 45ad46eb27
commit ba235c5615
6 changed files with 26 additions and 17 deletions

View File

@ -273,7 +273,7 @@ component_ut_pytest_esp32c2_generic:
- .rules:test:component_ut-esp32c2
needs:
- build_pytest_components_esp32c2
tags: [ esp32c2, generic ]
tags: [ esp32c2, generic, xtal_40mhz ]
component_ut_pytest_esp32c2_xtal_26mhz:
extends:
@ -338,7 +338,7 @@ test_app_test_pytest_esp32c2_generic:
- .rules:test:custom_test-esp32c2
needs:
- build_pytest_test_apps_esp32c2
tags: [ esp32c2, generic ]
tags: [ esp32c2, generic, xtal_40mhz ]
test_app_test_pytest_esp32c3_generic:
extends:
@ -652,6 +652,7 @@ test_app_test_esp32c2_generic:
tags:
- ESP32C2
- Example_GENERIC
- xtal_40mhz
test_app_test_005:
extends: .test_app_esp32c3_template
@ -920,6 +921,7 @@ UT_C2:
tags:
- ESP32C2_IDF
- UT_T1_1
- xtal_40mhz
UT_C3:
extends: .unit_test_esp32c3_template

View File

@ -320,6 +320,11 @@ class IdfPytestEmbedded:
for _target in [*SUPPORTED_TARGETS, *PREVIEW_TARGETS]:
item.add_marker(_target)
# add 'xtal_40mhz' tag as a default tag for esp32c2 target
for item in items:
if 'esp32c2' in item_marker_names(item) and 'xtal_26mhz' not in item_marker_names(item):
item.add_marker('xtal_40mhz')
# filter all the test cases with "nightly_run" marker
if os.getenv('INCLUDE_NIGHTLY_RUN') == '1':
# Do not filter nightly_run cases

View File

@ -51,6 +51,7 @@ markers =
wifi_high_traffic: wifi high traffic runners
wifi_wlan: wifi runner with a wireless NIC
xtal_26mhz: runner with 26MHz xtal on board
xtal_40mhz: runner with 40MHz xtal on board
external_flash: external flash memory connected via VSPI (FSPI)
sdcard_sdmode: sdcard running in SD mode
sdcard_spimode: sdcard running in SPI mode

View File

@ -2096,4 +2096,3 @@ tools/unit-test-app/idf_ext.py
tools/unit-test-app/main/app_main.c
tools/unit-test-app/tools/CreateSectionTable.py
tools/unit-test-app/tools/UnitTestParser.py
tools/unit-test-app/unit_test.py

View File

@ -7,3 +7,5 @@
"ESP32C3_IDF": "CONFIG_IDF_TARGET_ESP32C3=y"
"quad_psram": '{CONFIG_SPIRAM_MODE_QUAD=y} and {CONFIG_IDF_TARGET_ESP32S3=y}'
"octal_psram": '{CONFIG_SPIRAM_MODE_OCT=y} and {CONFIG_IDF_TARGET_ESP32S3=y}'
"xtal_26mhz": '{CONFIG_ESP32C2_XTAL_FREQ_26=y} and {CONFIG_IDF_TARGET_ESP32C2=y}'
"xtal_40mhz": '{CONFIG_ESP32C2_XTAL_FREQ_40=y} and {CONFIG_IDF_TARGET_ESP32C2=y}'

View File

@ -1,18 +1,7 @@
#!/usr/bin/env python
#
# Copyright 2018 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Test script for unit test case.
@ -307,7 +296,18 @@ def run_unit_test_cases(env, extra_data):
for ut_config in case_config:
Utility.console_log('Running unit test for config: ' + ut_config, 'O')
dut = env.get_dut('unit-test-app', app_path=UT_APP_PATH, app_config_name=ut_config, allow_dut_exception=True)
_app = ttfw_idf.UT(app_path=UT_APP_PATH, config_name=ut_config, target=env.default_dut_cls.TARGET)
baud = _app.get_sdkconfig_config_value('CONFIG_ESP_CONSOLE_UART_BAUDRATE')
if baud is None:
baud = 115200
Utility.console_log('Can\'t find console baudrate in sdkconfig, use 115200 as default')
else:
baud = int(baud, 10) if isinstance(baud, str) else baud
Utility.console_log('Console baudrate is {}'.format(baud))
dut = env.get_dut('unit-test-app', app_path=UT_APP_PATH, app_config_name=ut_config,
allow_dut_exception=True, baudrate=baud)
if len(case_config[ut_config]) > 0:
replace_app_bin(dut, 'unit-test-app', case_config[ut_config][0].get('app_bin'))
dut.start_app()