Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Updating Performance Files #182

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@
"libgirepository",
"loguru",
"mandatories",
"mobly",
"MANYTOONE",
"mypy",
"noqa",
"onnetwork",
"otbr",
"panid",
"pidof",
"PIXIT",
"pkill",
"pydantic",
Expand Down Expand Up @@ -97,7 +99,8 @@
"repr",
"zinfo",
"MCORE",
"elts"
"elts",
"PBKDF",
],
"allowCompoundWords": true,
"ignorePaths": [
Expand All @@ -115,7 +118,9 @@
"test_collections/matter/python_tests/docs/common_test_failures/",
"sdk_patch",
".devcontainer",
"test_collections/matter/sdk_tests/*.json"
"test_collections/matter/sdk_tests/*.json",
"test_collections/matter/sdk_tests/support/performance_tests/",
"test_collections/matter/config.py"
],
"enableFiletypes": [
"shellscript"
Expand Down
285 changes: 0 additions & 285 deletions jupyter/processing_log.ipynb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ async def execute(self) -> None:
# Generate the command argument by getting the test_parameters from
# project configuration
# comissioning method is omitted because it's handled by the test suite
command_arguments = generate_command_arguments(
command_arguments = await generate_command_arguments(
config=TestEnvironmentConfigMatter(**self.config),
omit_commissioning_method=True,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,26 @@
import loguru

from app.schemas.test_environment_config import TestEnvironmentConfig
from app.test_engine.logger import PYTHON_TEST_LEVEL

from test_collections.matter.test_environment_config import DutPairingModeEnum

from ...python_testing.models.utils import (
EXECUTABLE,
RUNNER_CLASS_PATH,
DUTCommissioningError,
handle_logs,
)
from ...sdk_container import SDKContainer

# Command line params
RUNNER_CLASS_PATH = "/root/python_testing/scripts/sdk/test_harness_client.py"
EXECUTABLE = "python3"


def generate_command_arguments(
async def generate_command_arguments(
config: TestEnvironmentConfig, omit_commissioning_method: bool = False
) -> list:
dut_config = config.dut_config # type: ignore[attr-defined]
test_parameters = config.test_parameters

pairing_mode = (
"on-network"
if dut_config.pairing_mode == "onnetwork"
if dut_config.pairing_mode == DutPairingModeEnum.ON_NETWORK
else dut_config.pairing_mode
)

Expand All @@ -61,26 +63,14 @@ def generate_command_arguments(
return arguments


def handle_logs(log_generator: Generator, logger: loguru.Logger) -> None:
for chunk in log_generator:
decoded_log = chunk.decode().strip()
log_lines = decoded_log.splitlines()
for line in log_lines:
logger.log(PYTHON_TEST_LEVEL, line)


class DUTCommissioningError(Exception):
pass


def commission_device(
async def commission_device(
config: TestEnvironmentConfig,
logger: loguru.Logger,
) -> None:
sdk_container: SDKContainer = SDKContainer()
sdk_container = SDKContainer(logger)

command = [f"{RUNNER_CLASS_PATH} commission"]
command_arguments = generate_command_arguments(config)
command_arguments = await generate_command_arguments(config)
command.extend(command_arguments)

exec_result = sdk_container.send_command(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import time

from chip import ChipDeviceCtrl
from matter_testing_support import (
from chip.testing.matter_testing import (
MatterBaseTest,
TestStep,
async_test_body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from chip.testing.matter_testing import (
CommissionDeviceTest,
MatterTestConfig,
TestStep,
get_test_info,
parse_matter_test_args,
run_tests,
TestStep
)

COMMISSION_ARGUMENT = "commission"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@


def test_python_file_parser() -> None:
file_path = Path(
"/app/backend/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_script/python_tests_info.json"
)
parent_path = Path(__file__).parent
file_path = parent_path.joinpath("test_python_script/python_tests_info.json")

tests = parse_python_script(file_path)

Expand Down
Loading