mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
CI: enable running unit tests in CI for S3
This commit is contained in:
parent
6d9740bc5d
commit
d9f5126d24
@ -10,6 +10,7 @@ assign_test:
|
||||
- build_ssc_esp32
|
||||
- build_esp_idf_tests_cmake_esp32
|
||||
- build_esp_idf_tests_cmake_esp32s2
|
||||
- build_esp_idf_tests_cmake_esp32s3
|
||||
- build_esp_idf_tests_cmake_esp32c3
|
||||
variables:
|
||||
SUBMODULES_TO_FETCH: "components/esptool_py/esptool"
|
||||
@ -58,6 +59,7 @@ update_test_cases:
|
||||
needs:
|
||||
- build_esp_idf_tests_cmake_esp32
|
||||
- build_esp_idf_tests_cmake_esp32s2
|
||||
- build_esp_idf_tests_cmake_esp32s3
|
||||
- build_esp_idf_tests_cmake_esp32c3
|
||||
artifacts:
|
||||
when: always
|
||||
|
@ -289,6 +289,13 @@ build_component_ut_esp32s2:
|
||||
variables:
|
||||
IDF_TARGET: esp32s2
|
||||
|
||||
build_component_ut_esp32s3:
|
||||
extends:
|
||||
- .build_component_ut_template
|
||||
- .rules:build:component_ut-esp32s3
|
||||
variables:
|
||||
IDF_TARGET: esp32s3
|
||||
|
||||
build_component_ut_esp32c3:
|
||||
extends:
|
||||
- .build_component_ut_template
|
||||
|
@ -382,6 +382,11 @@ test_app_test_esp32_generic:
|
||||
- .component_ut_template
|
||||
- .rules:test:component_ut-esp32s2
|
||||
|
||||
.component_ut_esp32s3_template:
|
||||
extends:
|
||||
- .component_ut_template
|
||||
- .rules:test:component_ut-esp32s3
|
||||
|
||||
.component_ut_esp32c3_template:
|
||||
extends:
|
||||
- .component_ut_template
|
||||
@ -399,6 +404,12 @@ component_ut_test_esp32s2:
|
||||
- ESP32S2
|
||||
- COMPONENT_UT_GENERIC
|
||||
|
||||
component_ut_test_esp32s3:
|
||||
extends: .component_ut_esp32s3_template
|
||||
tags:
|
||||
- ESP32S3
|
||||
- COMPONENT_UT_GENERIC
|
||||
|
||||
component_ut_test_esp32c3:
|
||||
extends: .component_ut_esp32c3_template
|
||||
tags:
|
||||
@ -421,6 +432,11 @@ component_ut_test_esp32c3:
|
||||
- .unit_test_template
|
||||
- .rules:test:unit_test-esp32s2
|
||||
|
||||
.unit_test_esp32s3_template:
|
||||
extends:
|
||||
- .unit_test_template
|
||||
- .rules:test:unit_test-esp32s3
|
||||
|
||||
.unit_test_esp32c3_template:
|
||||
extends:
|
||||
- .unit_test_template
|
||||
@ -674,6 +690,13 @@ UT_C3_FLASH_SUSPEND:
|
||||
- ESP32C3_IDF
|
||||
- UT_T1_Flash_Suspend
|
||||
|
||||
UT_S3:
|
||||
extends: .unit_test_esp32s3_template
|
||||
parallel: 20
|
||||
tags:
|
||||
- ESP32S3_IDF
|
||||
- UT_T1_1
|
||||
|
||||
.integration_test_template:
|
||||
extends:
|
||||
- .target_test_job_template
|
||||
|
@ -195,6 +195,7 @@ tools/ci/python_packages/ttfw_idf/DebugUtils.py
|
||||
tools/ci/python_packages/ttfw_idf/IDFApp.py
|
||||
tools/ci/python_packages/ttfw_idf/IDFAssignTest.py
|
||||
tools/ci/python_packages/ttfw_idf/IDFDUT.py
|
||||
tools/ci/python_packages/ttfw_idf/__init__.py
|
||||
tools/ci/python_packages/ttfw_idf/unity_test_parser.py
|
||||
tools/ci/python_packages/wifi_tools.py
|
||||
tools/ci/test_autocomplete.py
|
||||
|
@ -12,7 +12,7 @@ import yaml
|
||||
try:
|
||||
from yaml import CLoader as Loader
|
||||
except ImportError:
|
||||
from yaml import Loader as Loader
|
||||
from yaml import Loader as Loader # type: ignore
|
||||
|
||||
import gitlab_api
|
||||
from tiny_test_fw.Utility import CIAssignTest
|
||||
@ -79,30 +79,30 @@ class IDFAssignTest(CIAssignTest.AssignTest):
|
||||
class ExampleGroup(IDFCaseGroup):
|
||||
SORT_KEYS = CI_JOB_MATCH_KEYS = ['env_tag', 'target']
|
||||
|
||||
LOCAL_BUILD_DIR = 'build_examples'
|
||||
LOCAL_BUILD_DIR = 'build_examples' # type: ignore
|
||||
EXAMPLE_TARGETS = SUPPORTED_TARGETS + PREVIEW_TARGETS
|
||||
BUILD_JOB_NAMES = ['build_examples_cmake_{}'.format(target) for target in EXAMPLE_TARGETS]
|
||||
BUILD_JOB_NAMES = ['build_examples_cmake_{}'.format(target) for target in EXAMPLE_TARGETS] # type: ignore
|
||||
|
||||
|
||||
class TestAppsGroup(ExampleGroup):
|
||||
LOCAL_BUILD_DIR = 'build_test_apps'
|
||||
TEST_APP_TARGETS = SUPPORTED_TARGETS + PREVIEW_TARGETS
|
||||
BUILD_JOB_NAMES = ['build_test_apps_{}'.format(target) for target in TEST_APP_TARGETS]
|
||||
BUILD_JOB_NAMES = ['build_test_apps_{}'.format(target) for target in TEST_APP_TARGETS] # type: ignore
|
||||
|
||||
|
||||
class ComponentUTGroup(TestAppsGroup):
|
||||
LOCAL_BUILD_DIR = 'build_component_ut'
|
||||
UNIT_TEST_TARGETS = SUPPORTED_TARGETS + PREVIEW_TARGETS
|
||||
BUILD_JOB_NAMES = ['build_component_ut_{}'.format(target) for target in UNIT_TEST_TARGETS]
|
||||
BUILD_JOB_NAMES = ['build_component_ut_{}'.format(target) for target in UNIT_TEST_TARGETS] # type: ignore
|
||||
|
||||
|
||||
class UnitTestGroup(IDFCaseGroup):
|
||||
SORT_KEYS = ['test environment', 'tags', 'chip_target']
|
||||
CI_JOB_MATCH_KEYS = ['test environment']
|
||||
|
||||
LOCAL_BUILD_DIR = 'tools/unit-test-app/builds'
|
||||
LOCAL_BUILD_DIR = 'tools/unit-test-app/builds' # type: ignore
|
||||
UNIT_TEST_TARGETS = SUPPORTED_TARGETS + PREVIEW_TARGETS
|
||||
BUILD_JOB_NAMES = ['build_esp_idf_tests_cmake_{}'.format(target) for target in UNIT_TEST_TARGETS]
|
||||
BUILD_JOB_NAMES = ['build_esp_idf_tests_cmake_{}'.format(target) for target in UNIT_TEST_TARGETS] # type: ignore
|
||||
|
||||
MAX_CASE = 50
|
||||
ATTR_CONVERT_TABLE = {
|
||||
@ -111,6 +111,7 @@ class UnitTestGroup(IDFCaseGroup):
|
||||
DUT_CLS_NAME = {
|
||||
'esp32': 'ESP32DUT',
|
||||
'esp32s2': 'ESP32S2DUT',
|
||||
'esp32s3': 'ESP32S3DUT',
|
||||
'esp32c3': 'ESP32C3DUT',
|
||||
'esp8266': 'ESP8266DUT',
|
||||
}
|
||||
@ -322,7 +323,7 @@ if __name__ == '__main__':
|
||||
|
||||
SUPPORTED_TARGETS.extend(PREVIEW_TARGETS)
|
||||
|
||||
test_case_paths = [os.path.join(IDF_PATH_FROM_ENV, path) if not os.path.isabs(path) else path for path in args.test_case_paths]
|
||||
test_case_paths = [os.path.join(IDF_PATH_FROM_ENV, path) if not os.path.isabs(path) else path for path in args.test_case_paths] # type: ignore
|
||||
args_list = [test_case_paths, args.config]
|
||||
if args.case_group == 'example_test':
|
||||
assigner = ExampleAssignTest(*args_list)
|
||||
|
@ -29,7 +29,7 @@ import pexpect
|
||||
try:
|
||||
import Queue as _queue
|
||||
except ImportError:
|
||||
import queue as _queue
|
||||
import queue as _queue # type: ignore
|
||||
|
||||
from serial.tools import list_ports
|
||||
from tiny_test_fw import DUT, Utility
|
||||
@ -531,6 +531,18 @@ class ESP32S2DUT(IDFDUT):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class ESP32S3DUT(IDFDUT):
|
||||
TARGET = 'esp32s3'
|
||||
TOOLCHAIN_PREFIX = 'xtensa-esp32s3-elf-'
|
||||
|
||||
@classmethod
|
||||
def _get_rom(cls):
|
||||
return esptool.ESP32S3ROM
|
||||
|
||||
def erase_partition(self, esp, partition):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class ESP32C3DUT(IDFDUT):
|
||||
TARGET = 'esp32c3'
|
||||
TOOLCHAIN_PREFIX = 'riscv32-esp-elf-'
|
||||
@ -556,7 +568,7 @@ class ESP8266DUT(IDFDUT):
|
||||
|
||||
|
||||
def get_target_by_rom_class(cls):
|
||||
for c in [ESP32DUT, ESP32S2DUT, ESP32C3DUT, ESP8266DUT, IDFQEMUDUT]:
|
||||
for c in [ESP32DUT, ESP32S2DUT, ESP32S3DUT, ESP32C3DUT, ESP8266DUT, IDFQEMUDUT]:
|
||||
if c._get_rom() == cls:
|
||||
return c.TARGET
|
||||
return None
|
||||
@ -652,5 +664,5 @@ class IDFQEMUDUT(IDFDUT):
|
||||
|
||||
|
||||
class ESP32QEMUDUT(IDFQEMUDUT):
|
||||
TARGET = 'esp32'
|
||||
TOOLCHAIN_PREFIX = 'xtensa-esp32-elf-'
|
||||
TARGET = 'esp32' # type: ignore
|
||||
TOOLCHAIN_PREFIX = 'xtensa-esp32-elf-' # type: ignore
|
||||
|
@ -23,19 +23,21 @@ from tiny_test_fw import TinyFW, Utility
|
||||
|
||||
from .DebugUtils import CustomProcess, GDBBackend, OCDBackend # noqa: export DebugUtils for users
|
||||
from .IDFApp import UT, ComponentUTApp, Example, IDFApp, LoadableElfTestApp, TestApp # noqa: export all Apps for users
|
||||
from .IDFDUT import ESP32C3DUT, ESP32DUT, ESP32QEMUDUT, ESP32S2DUT, ESP8266DUT, IDFDUT # noqa: export DUTs for users
|
||||
from .IDFDUT import (ESP32C3DUT, ESP32DUT, ESP32QEMUDUT, ESP32S2DUT, ESP32S3DUT, # noqa: export DUTs for users
|
||||
ESP8266DUT, IDFDUT)
|
||||
from .unity_test_parser import TestFormat, TestResults
|
||||
|
||||
# pass TARGET_DUT_CLS_DICT to Env.py to avoid circular dependency issue.
|
||||
TARGET_DUT_CLS_DICT = {
|
||||
'ESP32': ESP32DUT,
|
||||
'ESP32S2': ESP32S2DUT,
|
||||
'ESP32S3': ESP32S3DUT,
|
||||
'ESP32C3': ESP32C3DUT,
|
||||
}
|
||||
|
||||
|
||||
try:
|
||||
string_type = basestring
|
||||
string_type = basestring # type: ignore
|
||||
except NameError:
|
||||
string_type = str
|
||||
|
||||
|
@ -2,4 +2,5 @@
|
||||
"8Mpsram": "CONFIG_SPIRAM_BANKSWITCH_ENABLE=y"
|
||||
"ESP32_IDF": "CONFIG_IDF_TARGET_ESP32=y"
|
||||
"ESP32S2_IDF": "CONFIG_IDF_TARGET_ESP32S2=y"
|
||||
"ESP32S3_IDF": "CONFIG_IDF_TARGET_ESP32S3=y"
|
||||
"ESP32C3_IDF": "CONFIG_IDF_TARGET_ESP32C3=y"
|
||||
|
@ -53,6 +53,8 @@ class Parser(object):
|
||||
TOOLCHAIN_FOR_TARGET = {
|
||||
'esp32': 'xtensa-esp32-elf-',
|
||||
'esp32s2': 'xtensa-esp32s2-elf-',
|
||||
'esp32s3': 'xtensa-esp32s3-elf-',
|
||||
'esp32c3': 'riscv32-esp-elf-',
|
||||
}
|
||||
|
||||
def __init__(self, binary_folder, node_index):
|
||||
|
Loading…
x
Reference in New Issue
Block a user