diff --git a/.gitlab/ci/pre_check.yml b/.gitlab/ci/pre_check.yml index 81f977d724a..dfb5262372d 100644 --- a/.gitlab/ci/pre_check.yml +++ b/.gitlab/ci/pre_check.yml @@ -140,6 +140,21 @@ check_submodule_sync: - git submodule update --recursive - echo "IDF was cloned from ${PUBLIC_IDF_URL} completely" + +snapshot_known_failure_cases: + extends: + - .pre_check_template + script: + - run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME} + - mkdir -p artifacts + - mv ${KNOWN_FAILURE_CASES_FILE_NAME} artifacts/${KNOWN_FAILURE_CASES_FILE_NAME}.freeze + artifacts: + paths: + - artifacts/${KNOWN_FAILURE_CASES_FILE_NAME}.freeze + expire_in: 1 week + when: always + + pipeline_variables: extends: - .pre_check_template diff --git a/tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml b/tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml index 20d1d281756..7db95ac674b 100644 --- a/tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml +++ b/tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml @@ -59,6 +59,8 @@ needs: - pipeline: $PARENT_PIPELINE_ID job: pipeline_variables + - pipeline: $PARENT_PIPELINE_ID + job: snapshot_known_failure_cases cache: # Usually do not need submodule-cache in target_test - key: pip-cache-${LATEST_GIT_TAG} @@ -74,7 +76,11 @@ when: always expire_in: 1 week script: + # Merge the current known failure cases file with snapshot_known_failure_cases file captured at pipeline start + # to avoid retry failures caused by later updates to the known failure cases file. - run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME} + - printf '\n' >> ${KNOWN_FAILURE_CASES_FILE_NAME} + - cat artifacts/${KNOWN_FAILURE_CASES_FILE_NAME}.freeze >> ${KNOWN_FAILURE_CASES_FILE_NAME} # get runner env config file - retry_failed git clone $TEST_ENV_CONFIG_REPO - run_cmd python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs