ci: always cleanup idf copy in ci

pull/13557/merge
Fu Hanxi 2024-04-16 14:11:31 +02:00
rodzic b5607cf43c
commit a4f691b88a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 19399699CF3C4B16
2 zmienionych plików z 11 dodań i 3 usunięć

Wyświetl plik

@ -194,8 +194,12 @@ build_clang_test_apps_esp32c6:
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- cd ${IDF_PATH}/tools/test_build_system
- 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
- pytest
--cleanup-idf-copy
--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_FILE_NAME}
pytest_build_system:

Wyświetl plik

@ -31,7 +31,7 @@ def pytest_runtest_makereport(item: typing.Any, call: typing.Any) -> typing.Gene
def should_clean_test_dir(request: FixtureRequest) -> bool:
# Only remove the test directory if the test has passed
return getattr(request.node, 'passed', False)
return getattr(request.node, 'passed', False) or request.config.getoption('cleanup_idf_copy', False)
def pytest_addoption(parser: pytest.Parser) -> None:
@ -40,6 +40,10 @@ def pytest_addoption(parser: pytest.Parser) -> None:
help='Directory for temporary files. If not specified, an OS-specific '
'temporary directory will be used.'
)
parser.addoption(
'--cleanup-idf-copy', action='store_true',
help='Always clean up the IDF copy after the test. By default, the copy is cleaned up only if the test passes.'
)
@pytest.fixture(scope='session')