Skip to content

Commit

Permalink
Merge branch 'main' into utilities_stress_stability
Browse files Browse the repository at this point in the history
  • Loading branch information
gladystonfranca authored Oct 23, 2024
2 parents 66c5a55 + 235543d commit 6ae30af
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .version_information
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.11-beta3+fall2024
v2.11+fall2024
2 changes: 1 addition & 1 deletion app/container_manager/container_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def create_container(
def destroy(self, container: Container) -> None:
if self.is_running(container):
container.kill()
container.remove()
container.remove(force=True)

def get_container(self, id_or_name: str) -> Optional[Container]:
try:
Expand Down
4 changes: 2 additions & 2 deletions test_collections/matter/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class MatterSettings(BaseSettings):

# SDK Docker Image
SDK_DOCKER_IMAGE: str = "connectedhomeip/chip-cert-bins"
SDK_DOCKER_TAG: str = "17b1a38e909e7874593bcb87c31be03a5866f1d4"
SDK_DOCKER_TAG: str = "f2e5de7e7978dd0748ba014f7b6ce593dad2fc88"
# SDK SHA: used to fetch test YAML from SDK.
SDK_SHA: str = "17b1a38e909e7874593bcb87c31be03a5866f1d4"
SDK_SHA: str = "f2e5de7e7978dd0748ba014f7b6ce593dad2fc88"

class Config:
case_sensitive = True
Expand Down
16 changes: 12 additions & 4 deletions test_collections/matter/sdk_tests/support/chip/chip_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,19 @@ async def stop(self) -> None:
if not self.__server_started:
return

self.sdk_container.send_command(
f'-SIGTERM -f "{self.__server_full_command}"', prefix="pkill"
)
try:
self.sdk_container.send_command(
f'-SIGTERM -f "{self.__server_full_command}"', prefix="pkill"
)
self.__wait_for_server_exit()
except Exception as e:
# Issue: https://github.com/project-chip/certification-tool/issues/414
self.logger.info(
"Could not get exit code after pkill command "
f"{self.__server_full_command}."
)
self.logger.debug(str(e))

self.__wait_for_server_exit()
self.__server_started = False

def trace_file_params(self, topic: str) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ def configure_interactions(args) -> []:


def run_test(script_path: str, class_name: str, config: MatterTestConfig) -> None:
# For a script_path like 'custom/TC_XYZ' the module is 'custom.TC_XYZ'
module = importlib.import_module(script_path.replace("/", "."))
TestClassReference = getattr(module, class_name)

manual_execution = 0 # false

try:
Expand All @@ -142,7 +138,17 @@ def run_test(script_path: str, class_name: str, config: MatterTestConfig) -> Non
manager.TestRunnerHooks()
) # shared object proxy # type: ignore

run_tests(TestClassReference, config, test_runner_hooks)
try:
# For a script_path like 'custom/TC_XYZ' the module is 'custom.TC_XYZ'
module = importlib.import_module(script_path.replace("/", "."))
TestClassReference = getattr(module, class_name)

run_tests(TestClassReference, config, test_runner_hooks)
except Exception as e:
test_runner_hooks.step_failure(
logger=None, logs=str(e), duration=0, request=None, received=None
)
test_runner_hooks.stop(duration=0)


def commission(config: MatterTestConfig) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ def step_success(self, logger: Any, logs: str, duration: int, request: Any) -> N
def step_failure(
self, logger: Any, logs: str, duration: int, request: Any, received: Any
) -> None:
self.mark_step_failure("Python test step failure")
failure_msg = "Python test step failure"
if logs:
failure_msg += f": {logs}"

self.mark_step_failure(failure_msg)

# Python tests with only 2 steps are the ones that don't follow the template.
# In the case of a test file with multiple test cases, more than one of these
Expand Down
8 changes: 8 additions & 0 deletions test_collections/matter/sdk_tests/support/sdk_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
)
DOCKER_PYTHON_TESTING_PATH = "/root/python_testing"

MAPPED_DATA_MODEL_VOLUME = "mapped_data_model_volume"
DOCKER_DATA_MODEL_PATH = DOCKER_PYTHON_TESTING_PATH + "/data_model"


# RPC Client Running on SDK Container
LOCAL_RPC_PYTHON_TESTING_PATH = Path(
LOCAL_TEST_COLLECTIONS_PATH + "/sdk_tests/support/python_testing/models/rpc_client/"
Expand Down Expand Up @@ -133,6 +137,10 @@ class SDKContainer(metaclass=Singleton):
"bind": DOCKER_PYTHON_TESTING_PATH,
"mode": "rw",
},
MAPPED_DATA_MODEL_VOLUME: {
"bind": DOCKER_DATA_MODEL_PATH,
"mode": "rw",
},
LOCAL_RPC_PYTHON_TESTING_PATH: {
"bind": DOCKER_RPC_PYTHON_TESTING_PATH,
"mode": "rw",
Expand Down

0 comments on commit 6ae30af

Please sign in to comment.