Merge branch 'ci/new-known_failure_cases_workflow(v5.2)' into 'release/v5.2'

ci: change known_failure_cases workflow(v5.2)

See merge request espressif/esp-idf!27967
This commit is contained in:
Jiang Jiang Jian 2024-02-19 10:59:16 +08:00
commit bc7ef70189
7 changed files with 56 additions and 29 deletions

View File

@ -516,10 +516,10 @@ build_clang_test_apps_esp32c6:
script:
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- cd ${IDF_PATH}/tools/test_build_system
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- python ${IDF_PATH}/tools/ci/get_known_failure_cases_file.py
- pytest --parallel-count ${CI_NODE_TOTAL:-1} --parallel-index ${CI_NODE_INDEX:-1}
--work-dir ${CI_PROJECT_DIR}/test_build_system --junitxml=${CI_PROJECT_DIR}/XUNIT_RESULT.xml
--ignore-result-files known_failure_cases/known_failure_cases.txt
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
pytest_build_system:
extends: .test_build_system_template

View File

@ -80,6 +80,9 @@ variables:
# This is used only if CI_PYTHON_TOOL_REPO is not empty.
CI_PYTHON_TOOL_BRANCH: ""
# Set this variable to specify the file name for the known failure cases.
KNOWN_FAILURE_CASES_FILE_NAME: "5.2.txt"
IDF_CI_BUILD: 1
################################################

View File

@ -307,13 +307,13 @@ test_pytest_qemu:
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
--modified-components ${MODIFIED_COMPONENTS}
--modified-files ${MODIFIED_FILES}
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- python tools/ci/get_known_failure_cases_file.py
- run_cmd pytest
--target $IDF_TARGET
-m qemu
--embedded-services idf,qemu
--junitxml=XUNIT_RESULT.xml
--ignore-result-files known_failure_cases/known_failure_cases.txt
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--app-info-filepattern \"list_job_*.txt\"
test_pytest_linux:
@ -337,10 +337,10 @@ test_pytest_linux:
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
--modified-components ${MODIFIED_COMPONENTS}
--modified-files ${MODIFIED_FILES}
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- python tools/ci/get_known_failure_cases_file.py
- run_cmd pytest
--target linux
-m host_test
--junitxml=XUNIT_RESULT.xml
--ignore-result-files known_failure_cases/known_failure_cases.txt
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--app-info-filepattern \"list_job_*.txt\"

View File

@ -26,7 +26,7 @@
junit: XUNIT_RESULT.xml
expire_in: 1 week
script:
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- python tools/ci/get_known_failure_cases_file.py
# get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
@ -46,7 +46,7 @@
- run_cmd pytest $TEST_DIR
-m \"${markers}\"
--junitxml=XUNIT_RESULT.xml
--ignore-result-files known_failure_cases/known_failure_cases.txt
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS}
@ -1261,7 +1261,7 @@ pytest_examples_openthread_br:
artifacts: false
tags: [ esp32c6, openthread_br ]
script:
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- python tools/ci/get_known_failure_cases_file.py
# get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
@ -1276,7 +1276,7 @@ pytest_examples_openthread_br:
- run_cmd pytest $TEST_DIR
-m \"${markers}\"
--junitxml=XUNIT_RESULT.xml
--ignore-result-files known_failure_cases/known_failure_cases.txt
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS}
@ -1295,7 +1295,7 @@ pytest_examples_openthread_bbr:
artifacts: false
tags: [ esp32c6, openthread_bbr ]
script:
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- python tools/ci/get_known_failure_cases_file.py
# get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
@ -1310,7 +1310,7 @@ pytest_examples_openthread_bbr:
- run_cmd pytest $TEST_DIR
-m \"${markers}\"
--junitxml=XUNIT_RESULT.xml
--ignore-result-files known_failure_cases/known_failure_cases.txt
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS}
@ -1327,7 +1327,7 @@ pytest_examples_openthread_sleep:
artifacts: false
tags: [ esp32c6, openthread_sleep ]
script:
- retry_failed git clone $KNOWN_FAILURE_CASES_REPO known_failure_cases
- python tools/ci/get_known_failure_cases_file.py
# get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
@ -1341,7 +1341,7 @@ pytest_examples_openthread_sleep:
- run_cmd pytest $TEST_DIR
-m \"${markers}\"
--junitxml=XUNIT_RESULT.xml
--ignore-result-files known_failure_cases/known_failure_cases.txt
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS}

View File

@ -1,6 +1,5 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import fnmatch
import glob
@ -66,6 +65,23 @@ def getenv(env_var: str) -> str:
raise Exception(f'Environment variable {env_var} not set') from e
def get_minio_client() -> Minio:
return Minio(
getenv('IDF_S3_SERVER').replace('https://', ''),
access_key=getenv('IDF_S3_ACCESS_KEY'),
secret_key=getenv('IDF_S3_SECRET_KEY'),
http_client=urllib3.PoolManager(
num_pools=10,
timeout=urllib3.Timeout.DEFAULT_TIMEOUT,
retries=urllib3.Retry(
total=5,
backoff_factor=0.2,
status_forcelist=[500, 502, 503, 504],
),
),
)
def _download_files(
pipeline_id: int,
*,
@ -168,19 +184,7 @@ if __name__ == '__main__':
args = parser.parse_args()
client = Minio(
getenv('IDF_S3_SERVER').replace('https://', ''),
access_key=getenv('IDF_S3_ACCESS_KEY'),
secret_key=getenv('IDF_S3_SECRET_KEY'),
http_client=urllib3.PoolManager(
timeout=urllib3.Timeout.DEFAULT_TIMEOUT,
retries=urllib3.Retry(
total=5,
backoff_factor=0.2,
status_forcelist=[500, 502, 503, 504],
),
),
)
client = get_minio_client()
ci_pipeline_id = args.pipeline_id or getenv('CI_PIPELINE_ID') # required
if args.action == 'download':

View File

@ -40,4 +40,5 @@ tools/templates/sample_component/include/main.h
tools/templates/sample_component/main.c
tools/ci/cleanup_ignore_lists.py
tools/ci/artifacts_handler.py
tools/ci/get_known_failure_cases_file.py
tools/unit-test-app/**/*

View File

@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import os
from artifacts_handler import get_minio_client
def getenv(env_var: str) -> str:
try:
return os.environ[env_var]
except KeyError as e:
raise Exception(f'Environment variable {env_var} not set') from e
if __name__ == '__main__':
client = get_minio_client()
file_name = getenv('KNOWN_FAILURE_CASES_FILE_NAME')
client.fget_object('ignore-test-result-files', file_name, file_name)