From 43f58f724d2522ef236190c4900919b37509538c Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Thu, 13 Oct 2022 13:51:15 +0800 Subject: [PATCH 1/3] ci: install pytest packages if job name has _pytest_ --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 866512c88f..0ecae332d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -159,7 +159,11 @@ cache: elif [[ "${CI_JOB_STAGE}" == "build" ]]; then run_cmd bash install.sh --enable-ci --enable-pytest 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 source ./export.sh From c756e0f4776e273a154488b55eff74ec34917bde Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Fri, 14 Oct 2022 11:12:28 +0800 Subject: [PATCH 2/3] ci: fix import path --- tools/test_apps/system/panic/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test_apps/system/panic/conftest.py b/tools/test_apps/system/panic/conftest.py index dc43e48c82..863cc41009 100644 --- a/tools/test_apps/system/panic/conftest.py +++ b/tools/test_apps/system/panic/conftest.py @@ -18,4 +18,4 @@ def monkeypatch_module(request: FixtureRequest) -> MonkeyPatch: @pytest.fixture(scope='module', autouse=True) 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) From de2be3bd88b142fe9f06b97b31f3b69f9a57a2f5 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Thu, 20 Oct 2022 20:35:05 +0800 Subject: [PATCH 3/3] ci: add parallel count for pytest target test jobs based on dashboard analysis --- .gitlab/ci/target-test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index e1a8694db5..7c88ecdd3b 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -32,7 +32,12 @@ # 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) - 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: extends: .pytest_template @@ -275,6 +280,7 @@ component_ut_pytest_esp32_generic: needs: - build_pytest_components_esp32 tags: [ esp32, generic ] + parallel: 2 component_ut_pytest_esp32_generic_multi_device: extends: @@ -331,6 +337,7 @@ component_ut_pytest_esp32s2_generic: needs: - build_pytest_components_esp32s2 tags: [ esp32s2, generic ] + parallel: 2 component_ut_pytest_esp32s2_generic_multi_device: extends: @@ -363,6 +370,7 @@ component_ut_pytest_esp32s3_generic: needs: - build_pytest_components_esp32s3 tags: [ esp32s3, generic ] + parallel: 2 component_ut_pytest_esp32s3_generic_multi_device: extends: