Merge branch 'ci/test_pytest_1_0_0' into 'master'

ci: use pytest-embedded 1.0.0

See merge request espressif/esp-idf!20239
This commit is contained in:
Fu Hanxi
2022-10-21 08:47:55 +08:00
3 changed files with 15 additions and 3 deletions

View File

@@ -159,7 +159,11 @@ cache:
elif [[ "${CI_JOB_STAGE}" == "build" ]]; then elif [[ "${CI_JOB_STAGE}" == "build" ]]; then
run_cmd bash install.sh --enable-ci --enable-pytest run_cmd bash install.sh --enable-ci --enable-pytest
else else
run_cmd bash install.sh --enable-ci if ! echo "${CI_JOB_NAME}" | egrep ".+_pytest_.+"; then
run_cmd bash install.sh --enable-ci
else
run_cmd bash install.sh --enable-ci --enable-pytest
fi
fi fi
source ./export.sh source ./export.sh

View File

@@ -32,7 +32,12 @@
# Runner tags are comma separated, replace the comma with " and " for markers # Runner tags are comma separated, replace the comma with " and " for markers
- job_tags=$(python tools/ci/python_packages/gitlab_api.py get_job_tags $CI_PROJECT_ID --job_id $CI_JOB_ID) - job_tags=$(python tools/ci/python_packages/gitlab_api.py get_job_tags $CI_PROJECT_ID --job_id $CI_JOB_ID)
- markers=$(echo $job_tags | sed -e "s/,/ and /g") - markers=$(echo $job_tags | sed -e "s/,/ and /g")
- run_cmd pytest $TEST_DIR -m \"${markers}\" --junitxml=XUNIT_RESULT.xml --known-failure-cases-file known_failure_cases/known_failure_cases.txt - run_cmd pytest $TEST_DIR
-m \"${markers}\"
--junitxml=XUNIT_RESULT.xml
--known-failure-cases-file known_failure_cases/known_failure_cases.txt
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
.pytest_examples_dir_template: .pytest_examples_dir_template:
extends: .pytest_template extends: .pytest_template
@@ -275,6 +280,7 @@ component_ut_pytest_esp32_generic:
needs: needs:
- build_pytest_components_esp32 - build_pytest_components_esp32
tags: [ esp32, generic ] tags: [ esp32, generic ]
parallel: 2
component_ut_pytest_esp32_generic_multi_device: component_ut_pytest_esp32_generic_multi_device:
extends: extends:
@@ -331,6 +337,7 @@ component_ut_pytest_esp32s2_generic:
needs: needs:
- build_pytest_components_esp32s2 - build_pytest_components_esp32s2
tags: [ esp32s2, generic ] tags: [ esp32s2, generic ]
parallel: 2
component_ut_pytest_esp32s2_generic_multi_device: component_ut_pytest_esp32s2_generic_multi_device:
extends: extends:
@@ -363,6 +370,7 @@ component_ut_pytest_esp32s3_generic:
needs: needs:
- build_pytest_components_esp32s3 - build_pytest_components_esp32s3
tags: [ esp32s3, generic ] tags: [ esp32s3, generic ]
parallel: 2
component_ut_pytest_esp32s3_generic_multi_device: component_ut_pytest_esp32s3_generic_multi_device:
extends: extends:

View File

@@ -18,4 +18,4 @@ def monkeypatch_module(request: FixtureRequest) -> MonkeyPatch:
@pytest.fixture(scope='module', autouse=True) @pytest.fixture(scope='module', autouse=True)
def replace_dut_class(monkeypatch_module: MonkeyPatch) -> None: def replace_dut_class(monkeypatch_module: MonkeyPatch) -> None:
monkeypatch_module.setattr('pytest_embedded_idf.dut.IdfDut', PanicTestDut) monkeypatch_module.setattr('pytest_embedded_idf.IdfDut', PanicTestDut)