CI: skip TC_IDM_10_3 for main branch

This commit is contained in:
WanqQixiang
2026-01-23 10:35:58 +08:00
parent a48ced16ba
commit cf35f3a246
5 changed files with 39 additions and 18 deletions
+6 -1
View File
@@ -551,7 +551,12 @@ pytest_esp32c6_esp_matter_dut:
- cp ${ESP_MATTER_PATH}/tools/ci/extended_color_light_wifi_pics_code.txt $ESP_MATTER_PATH/connectedhomeip/connectedhomeip/src/python_testing/
- pip install -r tools/ci/requirements-pytest.txt
- python3 -c "import os; os.environ['TEST_CHUNK'] = '$TEST_CHUNK'"
- pytest examples/ --target esp32c6 -m esp_matter_dut --junitxml=XUNIT_RESULT.xml --certification-json=$ESP_MATTER_PATH/tools/ci/certification_test_commands.json
- |
if [ $CI_PIPELINE_SOURCE == "merge_request_event" ]; then
pytest examples/ --target esp32c6 -m esp_matter_dut --junitxml=XUNIT_RESULT.xml --certification-json=$ESP_MATTER_PATH/tools/ci/certification_test_commands.json --ci-branch $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
else
pytest examples/ --target esp32c6 -m esp_matter_dut --junitxml=XUNIT_RESULT.xml --certification-json=$ESP_MATTER_PATH/tools/ci/certification_test_commands.json
fi
tags: ["esp32c6", "esp_matter_dut"]
parallel:
matrix:
+13
View File
@@ -127,11 +127,24 @@ def pytest_addoption(parser):
default="certification_test_commands.json",
help="Path to the certification test commands JSON file",
)
parser.addoption(
"--ci-branch",
action="store",
default="main",
help="Branch on which the CI runs",
)
@pytest.fixture(scope="session")
def certification_tests(request):
return request.config.getoption("--certification-json")
@pytest.fixture(scope="session")
def ci_branch(request):
return request.config.getoption("--ci-branch")
@pytest.fixture(autouse=True)
@multi_dut_fixture
def junit_properties(
+2 -2
View File
@@ -116,7 +116,7 @@ def test_matter_commissioning_c2(dut:Dut) -> None:
)
# Matter over wifi commissioning
def test_matter_commissioning_c6(dut:Dut, certification_tests: str) -> None:
def test_matter_commissioning_c6(dut:Dut, certification_tests: str, ci_branch: str) -> None:
light = dut
# BLE start advertising
light.expect(r'Configuring CHIPoBLE advertising', timeout=20)
@@ -144,7 +144,7 @@ def test_matter_commissioning_c6(dut:Dut, certification_tests: str) -> None:
light.write('matter esp factoryreset')
time.sleep(10)
run_python_certification_tests(light, certification_tests)
run_python_certification_tests(light, certification_tests, ci_branch)
result = re.findall(r'Run command failure', str(out_str))
if len(result) != 0:
+2 -1
View File
@@ -101,7 +101,8 @@
"TC_IDM_10_3": {
"script": "TC_DeviceConformance.py",
"test_case": "test_TC_IDM_10_3",
"args": ""
"args": "",
"skip_on_branch": "main"
},
"TC_IDM_10_2": {
"script": "TC_DeviceConformance.py",
+6 -4
View File
@@ -19,7 +19,7 @@ gitlab_api = GitLabAPI()
PYTEST_SSID = gitlab_api.ci_gitlab_pytest_ssid
PYTEST_PASSPHRASE = gitlab_api.ci_gitlab_pytest_passphrase
def load_test_commands(certification_tests: str):
def load_test_commands(certification_tests: str, ci_branch:str):
if not PYTEST_SSID or not PYTEST_PASSPHRASE:
raise ValueError("CI_GITLAB_PYTEST_SSID and CI_GITLAB_PYTEST_PASSPHRASE must be set as environment variables")
@@ -36,7 +36,9 @@ def load_test_commands(certification_tests: str):
for test_case_name, test_config in test_cases.items():
script = test_config["script"]
args = test_config.get("args", "")
if ci_branch == test_config.get("skip_on_branch", ""):
print(f"Skip {test_case_name} for {ci_branch} branch")
else:
if "test_case" in test_config:
test_param = f"--tests {test_config['test_case']}"
storage_path = f"--storage-path logs/{test_config['test_case']}.json"
@@ -115,9 +117,9 @@ def update_mr_description_with_results(markdown_content, chunk_id=None):
except Exception as e:
print(f"Failed to update MR description: {e}")
def run_python_certification_tests(dut:Dut, certification_tests:str) -> None:
def run_python_certification_tests(dut:Dut, certification_tests:str, ci_branch:str) -> None:
light = dut
test_commands = load_test_commands(certification_tests)
test_commands = load_test_commands(certification_tests, ci_branch)
num_commands = len(test_commands)
mid_index = (num_commands+1) // 2