mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'ci/skip_tc_idm_10_3_main' into 'main'
CI: skip TC_IDM_10_3 for main branch See merge request app-frameworks/esp-matter!1415
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/
|
- 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
|
- pip install -r tools/ci/requirements-pytest.txt
|
||||||
- python3 -c "import os; os.environ['TEST_CHUNK'] = '$TEST_CHUNK'"
|
- 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"]
|
tags: ["esp32c6", "esp_matter_dut"]
|
||||||
parallel:
|
parallel:
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
+13
@@ -127,11 +127,24 @@ def pytest_addoption(parser):
|
|||||||
default="certification_test_commands.json",
|
default="certification_test_commands.json",
|
||||||
help="Path to the certification test commands JSON file",
|
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")
|
@pytest.fixture(scope="session")
|
||||||
def certification_tests(request):
|
def certification_tests(request):
|
||||||
return request.config.getoption("--certification-json")
|
return request.config.getoption("--certification-json")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def ci_branch(request):
|
||||||
|
return request.config.getoption("--ci-branch")
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
@multi_dut_fixture
|
@multi_dut_fixture
|
||||||
def junit_properties(
|
def junit_properties(
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ def test_matter_commissioning_c2(dut:Dut) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Matter over wifi commissioning
|
# 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
|
light = dut
|
||||||
# BLE start advertising
|
# BLE start advertising
|
||||||
light.expect(r'Configuring CHIPoBLE advertising', timeout=20)
|
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')
|
light.write('matter esp factoryreset')
|
||||||
time.sleep(10)
|
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))
|
result = re.findall(r'Run command failure', str(out_str))
|
||||||
if len(result) != 0:
|
if len(result) != 0:
|
||||||
|
|||||||
@@ -101,7 +101,8 @@
|
|||||||
"TC_IDM_10_3": {
|
"TC_IDM_10_3": {
|
||||||
"script": "TC_DeviceConformance.py",
|
"script": "TC_DeviceConformance.py",
|
||||||
"test_case": "test_TC_IDM_10_3",
|
"test_case": "test_TC_IDM_10_3",
|
||||||
"args": ""
|
"args": "",
|
||||||
|
"skip_on_branch": "main"
|
||||||
},
|
},
|
||||||
"TC_IDM_10_2": {
|
"TC_IDM_10_2": {
|
||||||
"script": "TC_DeviceConformance.py",
|
"script": "TC_DeviceConformance.py",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ gitlab_api = GitLabAPI()
|
|||||||
PYTEST_SSID = gitlab_api.ci_gitlab_pytest_ssid
|
PYTEST_SSID = gitlab_api.ci_gitlab_pytest_ssid
|
||||||
PYTEST_PASSPHRASE = gitlab_api.ci_gitlab_pytest_passphrase
|
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:
|
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")
|
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():
|
for test_case_name, test_config in test_cases.items():
|
||||||
script = test_config["script"]
|
script = test_config["script"]
|
||||||
args = test_config.get("args", "")
|
args = test_config.get("args", "")
|
||||||
|
if ci_branch == test_config.get("skip_on_branch", ""):
|
||||||
if "test_case" in test_config:
|
print(f"Skip {test_case_name} for {ci_branch} branch")
|
||||||
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:
|
else:
|
||||||
storage_path = f"--storage-path logs/{test_case_name}.json"
|
if "test_case" in test_config:
|
||||||
command = f"python3 {script} {common_args} {storage_path} {args}".strip()
|
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({
|
test_commands.append({
|
||||||
"name": test_case_name,
|
"name": test_case_name,
|
||||||
"command": command
|
"command": command
|
||||||
})
|
})
|
||||||
|
|
||||||
return test_commands
|
return test_commands
|
||||||
|
|
||||||
@@ -115,9 +117,9 @@ def update_mr_description_with_results(markdown_content, chunk_id=None):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Failed to update MR description: {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
|
light = dut
|
||||||
test_commands = load_test_commands(certification_tests)
|
test_commands = load_test_commands(certification_tests, ci_branch)
|
||||||
|
|
||||||
num_commands = len(test_commands)
|
num_commands = len(test_commands)
|
||||||
mid_index = (num_commands+1) // 2
|
mid_index = (num_commands+1) // 2
|
||||||
|
|||||||
Reference in New Issue
Block a user