ci: apply idf-ci gitlab dynamic-pipeline-variables

Renamed env vars:

- TEST_CASE_FILTERS -> IDF_CI_SELECT_BY_FILTER_EXPR
- BUILD_AND_TEST_ALL_APPS -> IDF_CI_SELECT_ALL_PYTEST_CASES

Removed env vars;

- IS_MR_PIPELINE (could use CI_MERGE_REQUEST_IID)
- REPORT_EXIT_CODE -> IDF_CI_IS_DEBUG_PIPELINE (fail fast)
- PYTEST_IGNORE_COLLECT_IMPORT_ERROR -> always skip import error
This commit is contained in:
Fu Hanxi
2025-06-13 14:08:59 +02:00
parent 0d5b3e60ac
commit c80d0aded4
11 changed files with 18 additions and 62 deletions

View File

@@ -223,10 +223,10 @@ if __name__ == '__main__':
args = parser.parse_args()
if test_case_filters := os.getenv('TEST_CASE_FILTERS', None):
if test_case_filters := os.getenv('IDF_CI_SELECT_BY_FILTER_EXPR', None):
args.filter_expr = test_case_filters
if os.getenv('IS_MR_PIPELINE') == '0' or os.getenv('BUILD_AND_TEST_ALL_APPS') == '1':
if not os.getenv('CI_MERGE_REQUEST_IID') or os.getenv('IDF_CI_SELECT_ALL_PYTEST_CASES') == '1':
print('Build and run all test cases, and compile all cmake apps')
args.modified_components = None
args.modified_files = None

View File

@@ -109,8 +109,7 @@ def get_target_test_jobs(
else:
extra_include_yml = ['tools/ci/dynamic_pipelines/templates/generate_target_test_report.yml']
fast_pipeline_flag = int(os.getenv('REPORT_EXIT_CODE', 0)) == 30
if fast_pipeline_flag:
if os.getenv('IDF_CI_IS_DEBUG_PIPELINE') == '1':
extra_include_yml = ['tools/ci/dynamic_pipelines/templates/fast_pipeline.yml']
no_env_marker_test_cases.sort()

View File

@@ -20,6 +20,8 @@
needs:
- pipeline: $PARENT_PIPELINE_ID
job: generate_build_child_pipeline
- pipeline: $PARENT_PIPELINE_ID
job: pipeline_variables
artifacts:
paths:
# The other artifacts patterns are defined under tools/ci/artifacts_handler.py
@@ -49,6 +51,9 @@
image: $TARGET_TEST_ENV_IMAGE
stage: target_test
timeout: 1 hour
needs:
- pipeline: $PARENT_PIPELINE_ID
job: pipeline_variables
variables:
SUBMODULES_TO_FETCH: "none"
# set while generating the pipeline
@@ -70,10 +75,10 @@
paths:
- XUNIT_RESULT*.xml
- pytest-embedded/
# Child pipeline reports won't be collected in the main one
# https://gitlab.com/groups/gitlab-org/-/epics/8205
# reports:
# junit: XUNIT_RESULT.xml
# Child pipeline reports won't be collected in the main one
# https://gitlab.com/groups/gitlab-org/-/epics/8205
# reports:
# junit: XUNIT_RESULT.xml
when: always
expire_in: 1 week
script:

View File

@@ -39,7 +39,6 @@ Pytest Target Test Jobs:
- generate_pytest_child_pipeline
variables:
PARENT_PIPELINE_ID: $PARENT_PIPELINE_ID
REPORT_EXIT_CODE: $REPORT_EXIT_CODE
# https://gitlab.com/gitlab-org/gitlab/-/issues/214340
inherit:
variables: false