mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 11:03:05 +00:00
CI: skip TC_IDM_10_3 for main branch
This commit is contained in:
+6
-1
@@ -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
@@ -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(
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,19 +36,21 @@ 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 "test_case" in test_config:
|
||||
test_param = f"--tests {test_config['test_case']}"
|
||||
storage_path = f"--storage-path logs/{test_config['test_case']}.json"
|
||||
command = f"python3 {script} {common_args} {storage_path} {test_param} {args}".strip()
|
||||
if ci_branch == test_config.get("skip_on_branch", ""):
|
||||
print(f"Skip {test_case_name} for {ci_branch} branch")
|
||||
else:
|
||||
storage_path = f"--storage-path logs/{test_case_name}.json"
|
||||
command = f"python3 {script} {common_args} {storage_path} {args}".strip()
|
||||
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"
|
||||
command = f"python3 {script} {common_args} {storage_path} {test_param} {args}".strip()
|
||||
else:
|
||||
storage_path = f"--storage-path logs/{test_case_name}.json"
|
||||
command = f"python3 {script} {common_args} {storage_path} {args}".strip()
|
||||
|
||||
test_commands.append({
|
||||
"name": test_case_name,
|
||||
"command": command
|
||||
})
|
||||
test_commands.append({
|
||||
"name": test_case_name,
|
||||
"command": command
|
||||
})
|
||||
|
||||
return test_commands
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user