ci: enable test_apps s3 c3 tests

Refactor the tags a bit to make the tags could reuse the env markers.
They suppose to be the same thing.
This commit is contained in:
Fu Hanxi 2022-03-08 11:36:57 +08:00
parent d261840dbd
commit 851d832eb6
4 changed files with 62 additions and 78 deletions

View File

@ -93,6 +93,16 @@ build_pytest_components_esp32c3:
script:
- run_cmd python tools/ci/build_pytest_apps.py components --target esp32c3 --size-info $SIZE_INFO_LOCATION -vv
build_non_test_components_apps:
extends:
- .build_template
- .build_test_apps_template
- .rules:build:component_ut
variables:
IDF_TARGET: all
TEST_PREFIX: component_ut
TEST_RELATIVE_DIR: component_ut
build_pytest_test_apps_esp32:
extends:
- .build_pytest_template
@ -107,15 +117,19 @@ build_pytest_test_apps_esp32s2:
script:
- run_cmd python tools/ci/build_pytest_apps.py tools/test_apps --target esp32s2 --size-info $SIZE_INFO_LOCATION -vv
build_non_test_components_apps:
build_pytest_test_apps_esp32s3:
extends:
- .build_template
- .build_test_apps_template
- .rules:build:component_ut
variables:
IDF_TARGET: all
TEST_PREFIX: component_ut
TEST_RELATIVE_DIR: component_ut
- .build_pytest_template
- .rules:build:custom_test-esp32s3
script:
- run_cmd python tools/ci/build_pytest_apps.py tools/test_apps --target esp32s3 --size-info $SIZE_INFO_LOCATION -vv
build_pytest_test_apps_esp32c3:
extends:
- .build_pytest_template
- .rules:build:custom_test-esp32c3
script:
- run_cmd python tools/ci/build_pytest_apps.py tools/test_apps --target esp32c3 --size-info $SIZE_INFO_LOCATION -vv
.build_template_app_template:
extends: .build_template

View File

@ -3,6 +3,7 @@
stage: target_test
timeout: 1 hour
extends: .before_script_pytest
tags: [$TARGET, $ENV_MARKER]
artifacts:
when: always
paths:
@ -26,11 +27,8 @@ example_test_pytest_esp32_generic:
needs:
- build_pytest_examples_esp32
variables:
TARGET: esp32
TARGET: ESP32
ENV_MARKER: generic
tags: # in gitlab 14.1 or later, we can use `parallel: matrix` with the `tags` keyword. https://docs.gitlab.com/ee/ci/jobs/job_control.html#run-a-matrix-of-parallel-trigger-jobs
- ESP32
- Example_GENERIC
example_test_pytest_esp32s2_generic:
extends:
@ -39,11 +37,8 @@ example_test_pytest_esp32s2_generic:
needs:
- build_pytest_examples_esp32s2
variables:
TARGET: esp32s2
TARGET: ESP32S2
ENV_MARKER: generic
tags:
- ESP32S2
- Example_GENERIC
example_test_pytest_esp32s3_generic:
extends:
@ -52,11 +47,8 @@ example_test_pytest_esp32s3_generic:
needs:
- build_pytest_examples_esp32s3
variables:
TARGET: esp32s3
TARGET: ESP32S3
ENV_MARKER: generic
tags:
- ESP32S3
- Example_GENERIC
example_test_pytest_esp32c3_generic:
extends:
@ -65,11 +57,8 @@ example_test_pytest_esp32c3_generic:
needs:
- build_pytest_examples_esp32c3
variables:
TARGET: esp32c3
TARGET: ESP32C3
ENV_MARKER: generic
tags:
- ESP32C3
- Example_GENERIC
example_test_pytest_esp32c3_flash_suspend:
extends:
@ -78,11 +67,8 @@ example_test_pytest_esp32c3_flash_suspend:
needs:
- build_pytest_examples_esp32c3
variables:
TARGET: esp32c3
TARGET: ESP32C3
ENV_MARKER: flash_suspend
tags:
- ESP32C3_IDF
- UT_T1_Flash_Suspend
.pytest_components_dir_template:
extends: .pytest_template
@ -96,11 +82,8 @@ component_ut_pytest_esp32_generic:
needs:
- build_pytest_components_esp32
variables:
TARGET: esp32
TARGET: ESP32
ENV_MARKER: generic
tags:
- ESP32
- COMPONENT_UT_GENERIC
component_ut_pytest_esp32_ip101:
extends:
@ -109,11 +92,8 @@ component_ut_pytest_esp32_ip101:
needs:
- build_pytest_components_esp32
variables:
TARGET: esp32
TARGET: ESP32
ENV_MARKER: ip101
tags:
- ESP32
- COMPONENT_UT_IP101
component_ut_pytest_esp32_lan8720:
extends:
@ -122,11 +102,8 @@ component_ut_pytest_esp32_lan8720:
needs:
- build_pytest_components_esp32
variables:
TARGET: esp32
TARGET: ESP32
ENV_MARKER: lan8720
tags:
- ESP32
- COMPONENT_UT_LAN8720
component_ut_pytest_esp32s2_generic:
extends:
@ -135,11 +112,8 @@ component_ut_pytest_esp32s2_generic:
needs:
- build_pytest_components_esp32s2
variables:
TARGET: esp32s2
TARGET: ESP32S2
ENV_MARKER: generic
tags:
- ESP32S2
- COMPONENT_UT_GENERIC
component_ut_pytest_esp32s3_generic:
extends:
@ -148,11 +122,8 @@ component_ut_pytest_esp32s3_generic:
needs:
- build_pytest_components_esp32s3
variables:
TARGET: esp32s3
TARGET: ESP32S3
ENV_MARKER: generic
tags:
- ESP32S3
- COMPONENT_UT_GENERIC
component_ut_pytest_esp32s3_octal_psram:
extends:
@ -161,11 +132,8 @@ component_ut_pytest_esp32s3_octal_psram:
needs:
- build_pytest_components_esp32s3
variables:
TARGET: esp32s3
TARGET: ESP32S3
ENV_MARKER: octal_psram
tags:
- ESP32S3
- MSPI_F8R8
component_ut_pytest_esp32c3_generic:
extends:
@ -174,11 +142,8 @@ component_ut_pytest_esp32c3_generic:
needs:
- build_pytest_components_esp32c3
variables:
TARGET: esp32c3
TARGET: ESP32C3
ENV_MARKER: generic
tags:
- ESP32C3
- COMPONENT_UT_GENERIC
.pytest_test_apps_dir_template:
extends: .pytest_template
@ -192,12 +157,9 @@ test_app_test_pytest_esp32_generic:
needs:
- build_pytest_test_apps_esp32
variables:
TARGET: esp32
TARGET: ESP32
ENV_MARKER: generic
SETUP_TOOLS: "1" # need gdb
tags:
- ESP32
- Example_GENERIC
test_app_test_pytest_esp32s2_generic:
extends:
@ -206,12 +168,29 @@ test_app_test_pytest_esp32s2_generic:
needs:
- build_pytest_test_apps_esp32s2
variables:
TARGET: esp32s2
TARGET: ESP32S2
ENV_MARKER: generic
SETUP_TOOLS: "1" # need gdb
tags:
- ESP32S2
- Example_GENERIC
test_app_test_pytest_esp32s3_generic:
extends:
- .pytest_test_apps_dir_template
- .rules:test:custom_test-esp32s3
needs:
- build_pytest_test_apps_esp32s3
variables:
TARGET: ESP32S3
ENV_MARKER: generic
test_app_test_pytest_esp32c3_generic:
extends:
- .pytest_test_apps_dir_template
- .rules:test:custom_test-esp32c3
needs:
- build_pytest_test_apps_esp32c3
variables:
TARGET: ESP32C3
ENV_MARKER: generic
# for parallel jobs, CI_JOB_NAME will be "job_name index/total" (for example, "IT_001 1/2")
# we need to convert to pattern "job_name_index.yml"

View File

@ -2503,7 +2503,6 @@ tools/ci/python_packages/tiny_test_fw/DUT.py
tools/ci/python_packages/tiny_test_fw/Env.py
tools/ci/python_packages/tiny_test_fw/EnvConfig.py
tools/ci/python_packages/tiny_test_fw/TinyFW.py
tools/ci/python_packages/tiny_test_fw/Utility/CIAssignTest.py
tools/ci/python_packages/tiny_test_fw/Utility/CaseConfig.py
tools/ci/python_packages/tiny_test_fw/Utility/GitlabCIJob.py
tools/ci/python_packages/tiny_test_fw/Utility/TestCase.py

View File

@ -1,16 +1,5 @@
# Copyright 2015-2017 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: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Common logic to assign test cases to CI jobs.
@ -187,8 +176,11 @@ class AssignTest(object):
job_list = list()
for job_name in ci_config:
if 'pytest' in job_name:
continue
if self.CI_TEST_JOB_PATTERN.search(job_name) is not None:
job_list.extend(self._handle_parallel_attribute(job_name, ci_config[job_name]))
job_list.sort(key=lambda x: x['name'])
return job_list