ci: change known_failure_cases workflow

This commit is contained in:
igor.udot 2023-12-18 11:27:50 +08:00
parent 11eaf41b37
commit dc0f41f7be
7 changed files with 56 additions and 29 deletions

View File

@ -516,10 +516,10 @@ build_clang_test_apps_esp32c6:
script: script:
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh - ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- cd ${IDF_PATH}/tools/test_build_system - 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} - 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 --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: pytest_build_system:
extends: .test_build_system_template extends: .test_build_system_template

View File

@ -80,6 +80,9 @@ variables:
# This is used only if CI_PYTHON_TOOL_REPO is not empty. # This is used only if CI_PYTHON_TOOL_REPO is not empty.
CI_PYTHON_TOOL_BRANCH: "" 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 IDF_CI_BUILD: 1
################################################ ################################################

View File

@ -307,13 +307,13 @@ test_pytest_qemu:
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt" --collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
--modified-components ${MODIFIED_COMPONENTS} --modified-components ${MODIFIED_COMPONENTS}
--modified-files ${MODIFIED_FILES} --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 - run_cmd pytest
--target $IDF_TARGET --target $IDF_TARGET
-m qemu -m qemu
--embedded-services idf,qemu --embedded-services idf,qemu
--junitxml=XUNIT_RESULT.xml --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\" --app-info-filepattern \"list_job_*.txt\"
test_pytest_linux: test_pytest_linux:
@ -337,10 +337,10 @@ test_pytest_linux:
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt" --collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
--modified-components ${MODIFIED_COMPONENTS} --modified-components ${MODIFIED_COMPONENTS}
--modified-files ${MODIFIED_FILES} --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 - run_cmd pytest
--target linux --target linux
-m host_test -m host_test
--junitxml=XUNIT_RESULT.xml --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\" --app-info-filepattern \"list_job_*.txt\"

View File

@ -26,7 +26,7 @@
junit: XUNIT_RESULT.xml junit: XUNIT_RESULT.xml
expire_in: 1 week expire_in: 1 week
script: 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 # get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO - retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs - python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
@ -46,7 +46,7 @@
- run_cmd pytest $TEST_DIR - run_cmd pytest $TEST_DIR
-m \"${markers}\" -m \"${markers}\"
--junitxml=XUNIT_RESULT.xml --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-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1} --parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS} ${PYTEST_EXTRA_FLAGS}
@ -1261,7 +1261,7 @@ pytest_examples_openthread_br:
artifacts: false artifacts: false
tags: [ esp32c6, openthread_br ] tags: [ esp32c6, openthread_br ]
script: 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 # get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO - retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs - 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 - run_cmd pytest $TEST_DIR
-m \"${markers}\" -m \"${markers}\"
--junitxml=XUNIT_RESULT.xml --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-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1} --parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS} ${PYTEST_EXTRA_FLAGS}
@ -1295,7 +1295,7 @@ pytest_examples_openthread_bbr:
artifacts: false artifacts: false
tags: [ esp32c6, openthread_bbr ] tags: [ esp32c6, openthread_bbr ]
script: 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 # get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO - retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs - 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 - run_cmd pytest $TEST_DIR
-m \"${markers}\" -m \"${markers}\"
--junitxml=XUNIT_RESULT.xml --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-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1} --parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS} ${PYTEST_EXTRA_FLAGS}
@ -1327,7 +1327,7 @@ pytest_examples_openthread_sleep:
artifacts: false artifacts: false
tags: [ esp32c6, openthread_sleep ] tags: [ esp32c6, openthread_sleep ]
script: 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 # get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO - retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs - 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 - run_cmd pytest $TEST_DIR
-m \"${markers}\" -m \"${markers}\"
--junitxml=XUNIT_RESULT.xml --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-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1} --parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS} ${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 # SPDX-License-Identifier: Apache-2.0
import argparse import argparse
import fnmatch import fnmatch
import glob import glob
@ -66,6 +65,23 @@ def getenv(env_var: str) -> str:
raise Exception(f'Environment variable {env_var} not set') from e 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( def _download_files(
pipeline_id: int, pipeline_id: int,
*, *,
@ -168,19 +184,7 @@ if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
client = Minio( client = get_minio_client()
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],
),
),
)
ci_pipeline_id = args.pipeline_id or getenv('CI_PIPELINE_ID') # required ci_pipeline_id = args.pipeline_id or getenv('CI_PIPELINE_ID') # required
if args.action == 'download': if args.action == 'download':

View File

@ -40,4 +40,5 @@ tools/templates/sample_component/include/main.h
tools/templates/sample_component/main.c tools/templates/sample_component/main.c
tools/ci/cleanup_ignore_lists.py tools/ci/cleanup_ignore_lists.py
tools/ci/artifacts_handler.py tools/ci/artifacts_handler.py
tools/ci/get_known_failure_cases_file.py
tools/unit-test-app/**/* 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)