diff --git a/.coveragerc b/.coveragerc index e4ccb195..422abef1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,4 @@ [run] omit = */app/tests/* - */test_collections/sdk_tests/support/tests/* + */test_collections/matter/sdk_tests/support/tests/* diff --git a/.flake8 b/.flake8 index 6bfa52d5..6c88239e 100644 --- a/.flake8 +++ b/.flake8 @@ -1,7 +1,7 @@ [flake8] max-line-length = 88 extend-ignore = E203, W503 -exclude = .git,__pycache__,__init__.py,.mypy_cache,.pytest_cache,third_party,test_collections/sdk_tests/sdk_checkout +exclude = .git,__pycache__,__init__.py,.mypy_cache,.pytest_cache,third_party,test_collections/matter/sdk_tests/sdk_checkout ; Ignore max-line-length in autogenerated files per-file-ignores = test_collections/automated_and_semi_automated/**/*:E501 diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index b7de53f3..46b73038 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -17,6 +17,8 @@ jobs: steps: - name: Check out Git repository uses: actions/checkout@v3 + with: + submodules: recursive - name: Set up Python uses: actions/setup-python@v1 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 5089c57b..cfabc6bc 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -11,6 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: streetsidesoftware/cspell-action@v2 with: incremental_files_only: false diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 4290812b..204d63d8 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -35,6 +35,8 @@ jobs: steps: - name: Check out Git repository uses: actions/checkout@v3 + with: + submodules: recursive - name: Load .env file to job environent uses: cardinalby/export-env-action@v2 @@ -63,7 +65,7 @@ jobs: - name: Fetch yaml tests and runner run: | source $(poetry env info --path)/bin/activate - ./test_collections/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh + ./test_collections/matter/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh env: SERVER_NAME: localhost SERVER_HOST: http://localhost diff --git a/.gitignore b/.gitignore index 69188f07..f97f5541 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ test_environment.config SerialTests.lock test_db_creation.lock .sha_information -test_collections/sdk_tests/sdk_checkout \ No newline at end of file +test_collections/matter/sdk_tests/sdk_checkout \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 73c4fbe7..5932925b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "python_tests"] - path = test_collections/python_tests + path = test_collections/matter/python_tests url = https://github.com/project-chip/matter-test-scripts.git diff --git a/.isort.cfg b/.isort.cfg index 81118c57..3ce61539 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -5,4 +5,4 @@ force_grid_wrap = 0 use_parentheses = True ensure_newline_before_comments = True line_length = 88 -skip=test_collections/sdk_tests/sdk_checkout \ No newline at end of file +skip=test_collections/matter/sdk_tests/sdk_checkout \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index ee551557..0c76867b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -35,10 +35,10 @@ "python.testing.pytestPath": "/usr/local/bin/pytest", "python.testing.pytestArgs": [ "app/tests", - "test_collections/sdk_tests/support/tests", + "test_collections/matter/sdk_tests/support/tests", "--no-cov" ], "python.linting.ignorePatterns": [ - "test_collections/sdk_tests/sdk_checkout/**/*.py" + "test_collections/matter/sdk_tests/sdk_checkout/**/*.py" ] } \ No newline at end of file diff --git a/cspell.json b/cspell.json index 022f992a..ebaebce4 100644 --- a/cspell.json +++ b/cspell.json @@ -97,7 +97,7 @@ "allowCompoundWords": true, "ignorePaths": [ "logs", - "test_collections/python_tests/onboarding_payload_test_suite/", + "test_collections/matter/python_tests/onboarding_payload_test_suite/", "app/otbr_manager/avahi/avahi-daemon.conf", "*.ini", "*.toml", @@ -105,7 +105,7 @@ "Dockerfile", "*.pyc", ".vscode/*", - "test_collections/sdk_tests/sdk_checkout", + "test_collections/matter/sdk_tests/sdk_checkout", "sdk_patch", ".devcontainer" ], diff --git a/mypy.ini b/mypy.ini index f05e8b68..673bf218 100644 --- a/mypy.ini +++ b/mypy.ini @@ -25,10 +25,10 @@ warn_unused_ignores = True warn_unreachable = True namespace_packages = True exclude = (?x)( - # ignore python files in test_collections/sdk_tests/sdk_checkout + # ignore python files in test_collections/matter/sdk_tests/sdk_checkout # - sdk_runner # - yaml_tests/yaml/sdk - ^test_collections\/sdk_tests\/sdk_checkout\/ + ^test_collections\/matter\/sdk_tests\/sdk_checkout\/ ( sdk_runner | yaml_tests\/yaml\/sdk | diff --git a/prestart.sh b/prestart.sh index e84fed9c..f88739c5 100755 --- a/prestart.sh +++ b/prestart.sh @@ -27,9 +27,15 @@ python ./app/initial_data.py # Run Prestart scripts in test collections for dir in ./test_collections/* do - prestart=$dir/prestart.sh - # Only run prestart.sh if present/ - [ -x $prestart ] && $prestart + if [ -d $dir ]; then + prestart=$dir/prestart.sh + + # Only run prestart.sh if present and it's executable + if [ -x $prestart ]; then + echo "Running prestart script: $prestart" + $prestart + fi + fi done # We echo "complete" to ensure this scripts last command has exit code 0. diff --git a/scripts/test-local.sh b/scripts/test-local.sh index b8697cf0..c69c301a 100755 --- a/scripts/test-local.sh +++ b/scripts/test-local.sh @@ -33,8 +33,8 @@ done if [[ $RUN_ALL_TESTS -eq 1 ]]; then echo "Running all tests" - pytest --cov-config=.coveragerc --cov=app --cov=test_collections --cov-report=term-missing app/tests test_collections/sdk_tests/support/tests "${@}" + pytest --cov-config=.coveragerc --cov=app --cov=test_collections --cov-report=term-missing app/tests test_collections/matter/sdk_tests/support/tests "${@}" else echo "Skipping platform dependant tests" - pytest --cov-config=.coveragerc --cov=app --cov=test_collections --cov-report=term-missing --ignore=app/tests/platform_dependent_tests app/tests test_collections/sdk_tests/support/tests "${@}" + pytest --cov-config=.coveragerc --cov=app --cov=test_collections --cov-report=term-missing --ignore=app/tests/platform_dependent_tests app/tests test_collections/matter/sdk_tests/support/tests "${@}" fi diff --git a/test_collections/sdk_tests/__init__.py b/test_collections/matter/__init__.py similarity index 71% rename from test_collections/sdk_tests/__init__.py rename to test_collections/matter/__init__.py index 9520bb9f..757e0312 100644 --- a/test_collections/sdk_tests/__init__.py +++ b/test_collections/matter/__init__.py @@ -13,5 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .support.python_testing import custom_python_collection, sdk_python_collection -from .support.yaml_tests import custom_collection, sdk_collection +from .python_tests import onboarding_payload_collection +from .sdk_tests.support.python_testing import ( + custom_python_collection, + sdk_python_collection, +) +from .sdk_tests.support.yaml_tests import custom_collection, sdk_collection diff --git a/test_collections/sdk_tests/prestart.sh b/test_collections/matter/prestart.sh similarity index 89% rename from test_collections/sdk_tests/prestart.sh rename to test_collections/matter/prestart.sh index e0311324..da816989 100755 --- a/test_collections/sdk_tests/prestart.sh +++ b/test_collections/matter/prestart.sh @@ -16,8 +16,10 @@ # limitations under the License. # Paths -SDK_TESTS_DIR=$(dirname "$0") +SDK_TESTS_DIR=$(dirname "$0")/sdk_tests + cd $SDK_TESTS_DIR # Fetch code from SDK -./scripts/fetch_sdk_tests_and_runner.sh \ No newline at end of file +./scripts/fetch_sdk_tests_and_runner.sh + diff --git a/test_collections/matter/python_tests b/test_collections/matter/python_tests new file mode 160000 index 00000000..43c3f703 --- /dev/null +++ b/test_collections/matter/python_tests @@ -0,0 +1 @@ +Subproject commit 43c3f7030e1e27911204ec802e854ce603439ed8 diff --git a/test_collections/matter/sdk_tests/__init__.py b/test_collections/matter/sdk_tests/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test_collections/matter/sdk_tests/__init__.py @@ -0,0 +1 @@ + diff --git a/test_collections/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh b/test_collections/matter/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh similarity index 90% rename from test_collections/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh rename to test_collections/matter/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh index 52910b3d..7ed9bcc1 100755 --- a/test_collections/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh +++ b/test_collections/matter/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh @@ -16,14 +16,14 @@ set -e # See the License for the specific language governing permissions and # limitations under the License. -# Usage: ./test_collections/sdk_tests/fetch_sdk_tests_and_runner.sh [sdk path] +# Usage: ./test_collections/matter/sdk_tests/fetch_sdk_tests_and_runner.sh [sdk path] # # When an SDK path is supplied, the SDK_SHA from .env is ignored. # Otherwise a temporary checkout of matter sdk will be made. # Paths -ROOT_DIR=$(realpath $(dirname "$0")/../../..) -TEST_YAML_LOCK_PATH="$ROOT_DIR/.lock-test-yaml" +ROOT_DIR=$(realpath $(dirname "$0")/../..) + TMP_SDK_FOLDER="sdk-sparse" TMP_SDK_PATH="/tmp/$TMP_SDK_FOLDER" @@ -35,11 +35,7 @@ SDK_EXAMPLE_CHIP_TOOL_PATH="examples/chip-tool" SDK_EXAMPLE_PLACEHOLDER_PATH="examples/placeholder" SDK_DATA_MODEL_PATH="src/app/zap-templates/zcl/data-model/chip" -ENV_FILE="$ROOT_DIR/.env" - -TEST_COLLECTIONS_PATH="$ROOT_DIR/test_collections" -TEST_COLLECTIONS_SDK_CHECKOUT_PATH="$TEST_COLLECTIONS_PATH/sdk_tests/sdk_checkout" - +TEST_COLLECTIONS_SDK_CHECKOUT_PATH="$ROOT_DIR/sdk_tests/sdk_checkout" # YAML Files YAML_TEST_COLLECTION_PATH="$TEST_COLLECTIONS_SDK_CHECKOUT_PATH/yaml_tests" @@ -85,10 +81,6 @@ else then echo "Update is forced." SDK_CHECKOUT_VERSION=$SDK_SHA - elif [ -f "$TEST_YAML_LOCK_PATH" ] - then - echo "Test yaml are locked by '.lock-test-yaml', remove file to update." - exit 0 elif [ ! -f "$CURRENT_SDK_CHECKOUT_VERSION" ] || [[ $(< "$CURRENT_SDK_CHECKOUT_VERSION") != "$SDK_SHA" ]] then echo "Current version of test yaml needs to be updated to SDK: $SDK_SHA" SDK_CHECKOUT_VERSION=$SDK_SHA @@ -143,11 +135,6 @@ cd "$SDK_PATH/$SDK_PYTHON_DATA_MODEL_PATH" mkdir -p "$PYTHON_TESTING_TEST_COLLECTION_PATH/data_model" cp -R * "$PYTHON_TESTING_TEST_COLLECTION_PATH/data_model" -# Delete deprecated codegenerated python wrappers for yaml -rm -Rf "$TEST_COLLECTIONS_PATH/manual_tests" -rm -Rf "$TEST_COLLECTIONS_PATH/automated_and_semi_automated" -rm -Rf "$TEST_COLLECTIONS_PATH/app1_tests" - ### # Extract sdk runner and dependencies ### diff --git a/test_collections/sdk_tests/sdk_checkout/python_testing/scripts/custom/.gitkeep b/test_collections/matter/sdk_tests/sdk_checkout/python_testing/scripts/custom/.gitkeep similarity index 96% rename from test_collections/sdk_tests/sdk_checkout/python_testing/scripts/custom/.gitkeep rename to test_collections/matter/sdk_tests/sdk_checkout/python_testing/scripts/custom/.gitkeep index adc84bd8..c5274a27 100644 --- a/test_collections/sdk_tests/sdk_checkout/python_testing/scripts/custom/.gitkeep +++ b/test_collections/matter/sdk_tests/sdk_checkout/python_testing/scripts/custom/.gitkeep @@ -1,3 +1,3 @@ -- This is a placeholder file for the custom Python test folder -- Use this directory to include all customized Python test files -- The tests will be presented in a new test collection on the TH UI \ No newline at end of file +- This is a placeholder file for the custom Python test folder +- Use this directory to include all customized Python test files +- The tests will be presented in a new test collection on the TH UI diff --git a/test_collections/sdk_tests/sdk_checkout/yaml_tests/yaml/custom/.gitkeep b/test_collections/matter/sdk_tests/sdk_checkout/yaml_tests/yaml/custom/.gitkeep similarity index 96% rename from test_collections/sdk_tests/sdk_checkout/yaml_tests/yaml/custom/.gitkeep rename to test_collections/matter/sdk_tests/sdk_checkout/yaml_tests/yaml/custom/.gitkeep index d08ece25..70718895 100644 --- a/test_collections/sdk_tests/sdk_checkout/yaml_tests/yaml/custom/.gitkeep +++ b/test_collections/matter/sdk_tests/sdk_checkout/yaml_tests/yaml/custom/.gitkeep @@ -1,3 +1,3 @@ -- This is a placeholder file for the custom YAML folder -- Use this directory to include all customized YAML files -- The tests will be presented in a new test collection on the TH UI \ No newline at end of file +- This is a placeholder file for the custom YAML folder +- Use this directory to include all customized YAML files +- The tests will be presented in a new test collection on the TH UI diff --git a/test_collections/sdk_tests/support/tests/chip/__init__.py b/test_collections/matter/sdk_tests/support/__init__.py similarity index 100% rename from test_collections/sdk_tests/support/tests/chip/__init__.py rename to test_collections/matter/sdk_tests/support/__init__.py diff --git a/test_collections/sdk_tests/support/chip/__init__.py b/test_collections/matter/sdk_tests/support/chip/__init__.py similarity index 100% rename from test_collections/sdk_tests/support/chip/__init__.py rename to test_collections/matter/sdk_tests/support/chip/__init__.py diff --git a/test_collections/sdk_tests/support/chip/chip_tool.py b/test_collections/matter/sdk_tests/support/chip/chip_tool.py similarity index 98% rename from test_collections/sdk_tests/support/chip/chip_tool.py rename to test_collections/matter/sdk_tests/support/chip/chip_tool.py index 82b4d325..44de7f0e 100644 --- a/test_collections/sdk_tests/support/chip/chip_tool.py +++ b/test_collections/matter/sdk_tests/support/chip/chip_tool.py @@ -43,13 +43,10 @@ from app.singleton import Singleton from app.test_engine.logger import CHIP_LOG_FORMAT, CHIPTOOL_LEVEL from app.test_engine.logger import test_engine_logger as logger -from test_collections.sdk_tests.support.paths import SDK_CHECKOUT_PATH -from test_collections.sdk_tests.support.pics import PICS_FILE_PATH, set_pics_command -from test_collections.sdk_tests.support.sdk_container import ( - DOCKER_LOGS_PATH, - DOCKER_PAA_CERTS_PATH, - SDKContainer, -) + +from ..paths import SDK_CHECKOUT_PATH +from ..pics import PICS_FILE_PATH, set_pics_command +from ..sdk_container import DOCKER_LOGS_PATH, DOCKER_PAA_CERTS_PATH, SDKContainer # Chip Tool Parameters CHIP_TOOL_EXE = "./chip-tool" diff --git a/test_collections/sdk_tests/support/exec_run_in_container.py b/test_collections/matter/sdk_tests/support/exec_run_in_container.py similarity index 100% rename from test_collections/sdk_tests/support/exec_run_in_container.py rename to test_collections/matter/sdk_tests/support/exec_run_in_container.py diff --git a/test_collections/sdk_tests/support/models/matter_test_models.py b/test_collections/matter/sdk_tests/support/models/matter_test_models.py similarity index 100% rename from test_collections/sdk_tests/support/models/matter_test_models.py rename to test_collections/matter/sdk_tests/support/models/matter_test_models.py diff --git a/test_collections/sdk_tests/support/models/sdk_test_folder.py b/test_collections/matter/sdk_tests/support/models/sdk_test_folder.py similarity index 92% rename from test_collections/sdk_tests/support/models/sdk_test_folder.py rename to test_collections/matter/sdk_tests/support/models/sdk_test_folder.py index 93b8e6a6..24d36d2f 100644 --- a/test_collections/sdk_tests/support/models/sdk_test_folder.py +++ b/test_collections/matter/sdk_tests/support/models/sdk_test_folder.py @@ -15,7 +15,7 @@ # from pathlib import Path -from test_collections.sdk_tests.support.paths import SDK_CHECKOUT_PATH +from ..paths import SDK_CHECKOUT_PATH UNKNOWN_version = "Unknown" VERSION_FILE_FILENAME = ".version" @@ -34,7 +34,7 @@ def __init__(self, path: Path, filename_pattern: str = "*") -> None: def __version(self) -> str: """Read version string from .version file in - /app/backend/test_collections/sdk_tests/sdk_checkout path.""" + /app/backend/test_collections/matter/sdk_tests/sdk_checkout path.""" version_file_path = SDK_CHECKOUT_PATH / VERSION_FILE_FILENAME if not version_file_path.exists(): diff --git a/test_collections/sdk_tests/support/paths.py b/test_collections/matter/sdk_tests/support/paths.py similarity index 100% rename from test_collections/sdk_tests/support/paths.py rename to test_collections/matter/sdk_tests/support/paths.py diff --git a/test_collections/sdk_tests/support/pics.py b/test_collections/matter/sdk_tests/support/pics.py similarity index 100% rename from test_collections/sdk_tests/support/pics.py rename to test_collections/matter/sdk_tests/support/pics.py diff --git a/test_collections/sdk_tests/support/python_testing/__init__.py b/test_collections/matter/sdk_tests/support/python_testing/__init__.py similarity index 100% rename from test_collections/sdk_tests/support/python_testing/__init__.py rename to test_collections/matter/sdk_tests/support/python_testing/__init__.py diff --git a/test_collections/sdk_tests/support/python_testing/models/__init__.py b/test_collections/matter/sdk_tests/support/python_testing/models/__init__.py similarity index 100% rename from test_collections/sdk_tests/support/python_testing/models/__init__.py rename to test_collections/matter/sdk_tests/support/python_testing/models/__init__.py diff --git a/test_collections/sdk_tests/support/python_testing/models/python_test_models.py b/test_collections/matter/sdk_tests/support/python_testing/models/python_test_models.py similarity index 100% rename from test_collections/sdk_tests/support/python_testing/models/python_test_models.py rename to test_collections/matter/sdk_tests/support/python_testing/models/python_test_models.py diff --git a/test_collections/sdk_tests/support/python_testing/models/python_test_parser.py b/test_collections/matter/sdk_tests/support/python_testing/models/python_test_parser.py similarity index 98% rename from test_collections/sdk_tests/support/python_testing/models/python_test_parser.py rename to test_collections/matter/sdk_tests/support/python_testing/models/python_test_parser.py index e7efc1d6..8cdfcc7a 100644 --- a/test_collections/sdk_tests/support/python_testing/models/python_test_parser.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/python_test_parser.py @@ -18,11 +18,7 @@ from pathlib import Path from typing import Any, List, Optional, Union -from test_collections.sdk_tests.support.models.matter_test_models import ( - MatterTestStep, - MatterTestType, -) - +from ...models.matter_test_models import MatterTestStep, MatterTestType from .python_test_models import PythonTest, PythonTestType ARG_STEP_DESCRIPTION_INDEX = 1 diff --git a/test_collections/sdk_tests/support/python_testing/models/python_testing_hooks_proxy.py b/test_collections/matter/sdk_tests/support/python_testing/models/python_testing_hooks_proxy.py similarity index 100% rename from test_collections/sdk_tests/support/python_testing/models/python_testing_hooks_proxy.py rename to test_collections/matter/sdk_tests/support/python_testing/models/python_testing_hooks_proxy.py diff --git a/test_collections/sdk_tests/support/python_testing/models/rpc_client/test_harness_client.py b/test_collections/matter/sdk_tests/support/python_testing/models/rpc_client/test_harness_client.py similarity index 100% rename from test_collections/sdk_tests/support/python_testing/models/rpc_client/test_harness_client.py rename to test_collections/matter/sdk_tests/support/python_testing/models/rpc_client/test_harness_client.py diff --git a/test_collections/sdk_tests/support/python_testing/models/test_case.py b/test_collections/matter/sdk_tests/support/python_testing/models/test_case.py similarity index 98% rename from test_collections/sdk_tests/support/python_testing/models/test_case.py rename to test_collections/matter/sdk_tests/support/python_testing/models/test_case.py index 09764fd2..88845699 100644 --- a/test_collections/sdk_tests/support/python_testing/models/test_case.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/test_case.py @@ -25,10 +25,10 @@ from app.test_engine.models.test_case import CUSTOM_TEST_IDENTIFIER from app.user_prompt_support.prompt_request import OptionsSelectPromptRequest from app.user_prompt_support.user_prompt_support import UserPromptSupport -from test_collections.sdk_tests.support.chip.chip_tool import PICS_FILE_PATH -from test_collections.sdk_tests.support.sdk_container import SDKContainer -from test_collections.sdk_tests.support.utils import prompt_for_commissioning_mode +from ...chip.chip_tool import PICS_FILE_PATH +from ...sdk_container import SDKContainer +from ...utils import prompt_for_commissioning_mode from .python_test_models import PythonTest, PythonTestType from .python_testing_hooks_proxy import ( SDKPythonTestResultBase, diff --git a/test_collections/sdk_tests/support/python_testing/models/test_declarations.py b/test_collections/matter/sdk_tests/support/python_testing/models/test_declarations.py similarity index 96% rename from test_collections/sdk_tests/support/python_testing/models/test_declarations.py rename to test_collections/matter/sdk_tests/support/python_testing/models/test_declarations.py index 62e8560a..38e7be03 100644 --- a/test_collections/sdk_tests/support/python_testing/models/test_declarations.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/test_declarations.py @@ -20,8 +20,8 @@ TestCollectionDeclaration, TestSuiteDeclaration, ) -from test_collections.sdk_tests.support.models.sdk_test_folder import SDKTestFolder +from ...models.sdk_test_folder import SDKTestFolder from .python_test_models import MatterTestType, PythonTest from .test_case import PythonTestCase from .test_suite import PythonTestSuite, SuiteType diff --git a/test_collections/sdk_tests/support/python_testing/models/test_suite.py b/test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py similarity index 93% rename from test_collections/sdk_tests/support/python_testing/models/test_suite.py rename to test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py index 0e603897..cc893f9e 100644 --- a/test_collections/sdk_tests/support/python_testing/models/test_suite.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py @@ -19,11 +19,10 @@ from app.test_engine.logger import test_engine_logger as logger from app.test_engine.models import TestSuite from app.user_prompt_support.user_prompt_support import UserPromptSupport -from test_collections.sdk_tests.support.python_testing.models.utils import ( - commission_device, -) -from test_collections.sdk_tests.support.sdk_container import SDKContainer -from test_collections.sdk_tests.support.utils import prompt_for_commissioning_mode + +from ...sdk_container import SDKContainer +from ...utils import prompt_for_commissioning_mode +from .utils import commission_device class SuiteType(Enum): diff --git a/test_collections/sdk_tests/support/python_testing/models/utils.py b/test_collections/matter/sdk_tests/support/python_testing/models/utils.py similarity index 97% rename from test_collections/sdk_tests/support/python_testing/models/utils.py rename to test_collections/matter/sdk_tests/support/python_testing/models/utils.py index abf13068..ee001421 100644 --- a/test_collections/sdk_tests/support/python_testing/models/utils.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/utils.py @@ -22,7 +22,8 @@ from app.schemas.test_environment_config import TestEnvironmentConfig from app.test_engine.logger import PYTHON_TEST_LEVEL -from test_collections.sdk_tests.support.sdk_container import SDKContainer + +from ...sdk_container import SDKContainer # Command line params RUNNER_CLASS_PATH = "/root/python_testing/scripts/sdk/test_harness_client.py" diff --git a/test_collections/sdk_tests/support/python_testing/sdk_python_tests.py b/test_collections/matter/sdk_tests/support/python_testing/sdk_python_tests.py similarity index 94% rename from test_collections/sdk_tests/support/python_testing/sdk_python_tests.py rename to test_collections/matter/sdk_tests/support/python_testing/sdk_python_tests.py index 13e10daf..0d62c182 100644 --- a/test_collections/sdk_tests/support/python_testing/sdk_python_tests.py +++ b/test_collections/matter/sdk_tests/support/python_testing/sdk_python_tests.py @@ -16,9 +16,8 @@ from pathlib import Path from typing import Optional -from test_collections.sdk_tests.support.models.sdk_test_folder import SDKTestFolder -from test_collections.sdk_tests.support.paths import SDK_CHECKOUT_PATH - +from ..models.sdk_test_folder import SDKTestFolder +from ..paths import SDK_CHECKOUT_PATH from .models.python_test_models import PythonTestType from .models.python_test_parser import parse_python_script from .models.test_declarations import ( @@ -30,9 +29,9 @@ ### # This file hosts logic to load and parse Python test cases, located in -# `test_collections/sdk_tests/sdk_checkout/python_testing/scripts/sdk`. +# `test_collections/matter/sdk_tests/sdk_checkout/python_testing/scripts/sdk`. # The `sdk` sub-folder here is automatically maintained using the -# `test_collections/sdk_tests/fetch_sdk_tests_and_runner.sh` script. +# `test_collections/matter/sdk_tests/fetch_sdk_tests_and_runner.sh` script. # # The Python Tests are organized into 1 Test Suite: # - Automated diff --git a/test_collections/sdk_tests/support/sdk_container.py b/test_collections/matter/sdk_tests/support/sdk_container.py similarity index 97% rename from test_collections/sdk_tests/support/sdk_container.py rename to test_collections/matter/sdk_tests/support/sdk_container.py index b4c8c6fa..50ae205d 100644 --- a/test_collections/sdk_tests/support/sdk_container.py +++ b/test_collections/matter/sdk_tests/support/sdk_container.py @@ -26,9 +26,9 @@ from app.schemas.pics import PICS, PICSError from app.singleton import Singleton from app.test_engine.logger import test_engine_logger as logger -from test_collections.sdk_tests.support.pics import set_pics_command from .exec_run_in_container import ExecResultExtended, exec_run_in_container +from .pics import set_pics_command # Trace mount LOCAL_LOGS_PATH = Path("/var/tmp") @@ -43,7 +43,10 @@ DOCKER_CREDENTIALS_DEVELOPMENT_PATH = "/credentials/development" # Python Testing Folder -LOCAL_TEST_COLLECTIONS_PATH = "/home/ubuntu/certification-tool/backend/test_collections" +LOCAL_TEST_COLLECTIONS_PATH = ( + "/home/ubuntu/certification-tool/backend/test_collections/matter" +) + LOCAL_PYTHON_TESTING_PATH = Path( LOCAL_TEST_COLLECTIONS_PATH + "/sdk_tests/sdk_checkout/python_testing" ) diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/other_file_to_be_ignored.yaml b/test_collections/matter/sdk_tests/support/tests/__init__.py similarity index 100% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/other_file_to_be_ignored.yaml rename to test_collections/matter/sdk_tests/support/tests/__init__.py diff --git a/test_collections/matter/sdk_tests/support/tests/chip/__init__.py b/test_collections/matter/sdk_tests/support/tests/chip/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test_collections/sdk_tests/support/tests/chip/test_chip_tool.py b/test_collections/matter/sdk_tests/support/tests/chip/test_chip_tool.py similarity index 97% rename from test_collections/sdk_tests/support/tests/chip/test_chip_tool.py rename to test_collections/matter/sdk_tests/support/tests/chip/test_chip_tool.py index d87bde7e..7e523b4f 100644 --- a/test_collections/sdk_tests/support/tests/chip/test_chip_tool.py +++ b/test_collections/matter/sdk_tests/support/tests/chip/test_chip_tool.py @@ -29,8 +29,9 @@ from app.core.config import settings from app.schemas.pics import PICSError from app.tests.utils.test_pics_data import create_random_pics -from test_collections.sdk_tests.support.chip import ChipTool -from test_collections.sdk_tests.support.chip.chip_tool import ( + +from ...chip import ChipTool +from ...chip.chip_tool import ( CHIP_APP_EXE, CHIP_TOOL_ARG_PAA_CERTS_PATH, CHIP_TOOL_CONTINUE_ON_FAILURE_VALUE, @@ -42,13 +43,9 @@ ChipToolStartingError, ChipToolUnknownTestType, ) -from test_collections.sdk_tests.support.exec_run_in_container import ExecResultExtended -from test_collections.sdk_tests.support.pics import ( - PICS_FILE_PATH, - SHELL_OPTION, - SHELL_PATH, -) -from test_collections.sdk_tests.support.sdk_container import SDKContainer +from ...exec_run_in_container import ExecResultExtended +from ...pics import PICS_FILE_PATH, SHELL_OPTION, SHELL_PATH +from ...sdk_container import SDKContainer @pytest.mark.asyncio @@ -291,7 +288,9 @@ async def test_set_pics() -> None: ) with mock.patch( - target="test_collections.sdk_tests.support.chip.chip_tool.subprocess.run", + target=( + "test_collections.matter.sdk_tests.support.chip.chip_tool.subprocess.run" + ), return_value=CompletedProcess(expected_command, 0), ) as mock_run: chip_tool.set_pics(pics) @@ -308,7 +307,9 @@ def test_set_pics_with_error() -> None: pics = create_random_pics() with mock.patch( - target="test_collections.sdk_tests.support.chip.chip_tool.subprocess.run", + target=( + "test_collections.matter.sdk_tests.support.chip.chip_tool.subprocess.run" + ), return_value=CompletedProcess("", 1), ), pytest.raises(PICSError): chip_tool.set_pics(pics) diff --git a/test_collections/matter/sdk_tests/support/tests/python_tests/__init__.py b/test_collections/matter/sdk_tests/support/tests/python_tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test_collections/sdk_tests/support/tests/python_tests/test_python_folder.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_folder.py similarity index 93% rename from test_collections/sdk_tests/support/tests/python_tests/test_python_folder.py rename to test_collections/matter/sdk_tests/support/tests/python_tests/test_python_folder.py index 3636f8bf..1b6f6056 100644 --- a/test_collections/sdk_tests/support/tests/python_tests/test_python_folder.py +++ b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_folder.py @@ -17,7 +17,7 @@ from pathlib import Path from unittest import mock -from test_collections.sdk_tests.support.models.sdk_test_folder import SDKTestFolder +from ...models.sdk_test_folder import SDKTestFolder test_python_path = Path("/test/python") @@ -28,7 +28,7 @@ def test_python_folder_version() -> None: # We mock open to read version_file_content and Path exists to ignore that we're # testing with a fake path with mock.patch( - "test_collections.sdk_tests.support.models.sdk_test_folder.open", + "test_collections.matter.sdk_tests.support.models.sdk_test_folder.open", new=mock.mock_open(read_data=version_file_content), ), mock.patch.object(target=Path, attribute="exists", return_value=True) as _: python_test_folder = SDKTestFolder(test_python_path) diff --git a/test_collections/sdk_tests/support/tests/python_tests/test_python_parser.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_parser.py similarity index 92% rename from test_collections/sdk_tests/support/tests/python_tests/test_python_parser.py rename to test_collections/matter/sdk_tests/support/tests/python_tests/test_python_parser.py index c9b305be..8c709cef 100644 --- a/test_collections/sdk_tests/support/tests/python_tests/test_python_parser.py +++ b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_parser.py @@ -18,9 +18,7 @@ from pathlib import Path from unittest import mock -from test_collections.sdk_tests.support.python_testing.models.python_test_parser import ( - parse_python_script, -) +from ...python_testing.models.python_test_parser import parse_python_script sample_single_test_python_file_content = """ class TC_Sample(MatterBaseTest): @@ -103,7 +101,7 @@ def test_single_test_python_file_parser() -> None: # We mock builtin `open` method to read sample python file content, # to avoid having to load a real file. with mock.patch( - "test_collections.sdk_tests.support.python_testing.models.python_test_parser." + "test_collections.matter.sdk_tests.support.python_testing.models.python_test_parser." "open", new=mock.mock_open(read_data=sample_single_test_python_file_content), ) as file_open: @@ -125,7 +123,7 @@ def test_multi_tests_single_class_python_file_parser() -> None: # We mock builtin `open` method to read sample python file content, # to avoid having to load a real file. with mock.patch( - "test_collections.sdk_tests.support.python_testing.models.python_test_parser." + "test_collections.matter.sdk_tests.support.python_testing.models.python_test_parser." "open", new=mock.mock_open( read_data=sample_multi_tests_single_class_python_file_content @@ -149,7 +147,7 @@ def test_multi_tests_multi_classes_python_file_parser() -> None: # We mock builtin `open` method to read sample python file content, # to avoid having to load a real file. with mock.patch( - "test_collections.sdk_tests.support.python_testing.models.python_test_parser." + "test_collections.matter.sdk_tests.support.python_testing.models.python_test_parser." "open", new=mock.mock_open( read_data=sample_multi_tests_multi_classes_python_file_content diff --git a/test_collections/sdk_tests/support/tests/python_tests/test_python_script/TC_Sample.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_script/TC_Sample.py similarity index 100% rename from test_collections/sdk_tests/support/tests/python_tests/test_python_script/TC_Sample.py rename to test_collections/matter/sdk_tests/support/tests/python_tests/test_python_script/TC_Sample.py diff --git a/test_collections/sdk_tests/support/tests/python_tests/test_python_test_case.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_case.py similarity index 95% rename from test_collections/sdk_tests/support/tests/python_tests/test_python_test_case.py rename to test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_case.py index cbe6ef99..95002676 100644 --- a/test_collections/sdk_tests/support/tests/python_tests/test_python_test_case.py +++ b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_case.py @@ -23,15 +23,10 @@ from app.models.test_case_execution import TestCaseExecution from app.test_engine.logger import test_engine_logger -from test_collections.sdk_tests.support.models.matter_test_models import ( - MatterTestStep, - MatterTestType, -) -from test_collections.sdk_tests.support.python_testing.models import PythonTestCase -from test_collections.sdk_tests.support.python_testing.models.python_test_models import ( - PythonTest, - PythonTestType, -) + +from ...models.matter_test_models import MatterTestStep, MatterTestType +from ...python_testing.models import PythonTestCase +from ...python_testing.models.python_test_models import PythonTest, PythonTestType def python_test_instance( diff --git a/test_collections/sdk_tests/support/tests/python_tests/test_python_test_declarations.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_declarations.py similarity index 78% rename from test_collections/sdk_tests/support/tests/python_tests/test_python_test_declarations.py rename to test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_declarations.py index 39c66e09..191f8681 100644 --- a/test_collections/sdk_tests/support/tests/python_tests/test_python_test_declarations.py +++ b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_declarations.py @@ -17,17 +17,12 @@ # Ignore flake8 check for this file from unittest import mock -from test_collections.sdk_tests.support.python_testing.models.python_test_models import ( - PythonTest, - PythonTestType, -) -from test_collections.sdk_tests.support.python_testing.models.test_declarations import ( +from ...python_testing.models.python_test_models import PythonTest, PythonTestType +from ...python_testing.models.test_declarations import ( PythonCaseDeclaration, PythonSuiteDeclaration, ) -from test_collections.sdk_tests.support.python_testing.models.test_suite import ( - SuiteType, -) +from ...python_testing.models.test_suite import SuiteType def test_python_suite_declaration() -> None: @@ -36,7 +31,7 @@ def test_python_suite_declaration() -> None: version = "SomeVersionStr" with mock.patch( - "test_collections.sdk_tests.support.python_testing.models.test_suite.PythonTestSuite.class_factory" + "test_collections.matter.sdk_tests.support.python_testing.models.test_suite.PythonTestSuite.class_factory" ) as class_factory, mock.patch( "app.test_engine.models.test_declarations.TestSuiteDeclaration.__init__" ) as declaration_init: @@ -58,7 +53,7 @@ def test_python_case_declaration() -> None: ) version = "SomeVersionStr" with mock.patch( - "test_collections.sdk_tests.support.python_testing.models.test_case.PythonTestCase.class_factory" + "test_collections.matter.sdk_tests.support.python_testing.models.test_case.PythonTestCase.class_factory" ) as class_factory, mock.patch( "app.test_engine.models.test_declarations.TestCaseDeclaration.__init__" ) as declaration_init: diff --git a/test_collections/sdk_tests/support/tests/python_tests/test_python_test_suite.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_suite.py similarity index 81% rename from test_collections/sdk_tests/support/tests/python_tests/test_python_test_suite.py rename to test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_suite.py index 974a9ee1..bf6fe49b 100644 --- a/test_collections/sdk_tests/support/tests/python_tests/test_python_test_suite.py +++ b/test_collections/matter/sdk_tests/support/tests/python_tests/test_python_test_suite.py @@ -25,12 +25,13 @@ from app.schemas import PICS from app.test_engine.logger import test_engine_logger from app.tests.utils.test_pics_data import create_random_pics -from test_collections.sdk_tests.support.python_testing.models.test_suite import ( + +from ...python_testing.models.test_suite import ( CommissioningPythonTestSuite, PythonTestSuite, SuiteType, ) -from test_collections.sdk_tests.support.sdk_container import SDKContainer +from ...sdk_container import SDKContainer def test_python_suite_class_factory_name() -> None: @@ -91,17 +92,17 @@ async def test_suite_setup_log_python_version() -> None: ) as logger_info, mock.patch.object( target=sdk_container, attribute="start" ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.pics", new_callable=PICS, ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".prompt_for_commissioning_mode", ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".commission_device", ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.config", new_callable=mock.PropertyMock, return_value=default_environment_config, @@ -126,7 +127,7 @@ async def test_suite_setup_without_pics() -> None: suite_instance = suite_class(TestSuiteExecution()) with mock.patch.object(target=sdk_container, attribute="start"), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.pics", new_callable=PICS, ), mock.patch.object( @@ -134,13 +135,13 @@ async def test_suite_setup_without_pics() -> None: ) as mock_set_pics, mock.patch.object( target=sdk_container, attribute="reset_pics_state" ) as mock_reset_pics_state, mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".prompt_for_commissioning_mode", ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".commission_device", ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.config", new_callable=mock.PropertyMock, return_value=default_environment_config, @@ -165,7 +166,7 @@ async def test_suite_setup_with_pics() -> None: suite_instance = suite_class(TestSuiteExecution()) with mock.patch.object(target=sdk_container, attribute="start"), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.pics", new_callable=create_random_pics, ), mock.patch.object( @@ -173,13 +174,13 @@ async def test_suite_setup_with_pics() -> None: ) as mock_set_pics, mock.patch.object( target=sdk_container, attribute="reset_pics_state" ) as mock_reset_pics_state, mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".prompt_for_commissioning_mode", ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".commission_device", ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.config", new_callable=mock.PropertyMock, return_value=default_environment_config, @@ -205,17 +206,17 @@ async def test_commissioning_suite_setup_with_pics() -> None: suite_instance = suite_class(TestSuiteExecution()) with mock.patch.object(target=sdk_container, attribute="start"), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.pics", new_callable=PICS, ), mock.patch.object(target=sdk_container, attribute="set_pics"), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".prompt_for_commissioning_mode", ) as mock_prompt_for_commissioning_mode, mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".commission_device", ) as mock_commission_device, mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.config", new_callable=mock.PropertyMock, return_value=default_environment_config, @@ -241,16 +242,16 @@ async def test_commissioning_suite_setup() -> None: suite_instance = suite_class(TestSuiteExecution()) with mock.patch( - "test_collections.sdk_tests.support.python_testing.models.test_suite" + "test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.setup" ) as python_suite_setup, mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".prompt_for_commissioning_mode", ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".commission_device", ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.test_suite" + target="test_collections.matter.sdk_tests.support.python_testing.models.test_suite" ".PythonTestSuite.config", new_callable=mock.PropertyMock, return_value=default_environment_config, diff --git a/test_collections/sdk_tests/support/tests/python_tests/test_sdk_python_collection.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_sdk_python_collection.py similarity index 82% rename from test_collections/sdk_tests/support/tests/python_tests/test_sdk_python_collection.py rename to test_collections/matter/sdk_tests/support/tests/python_tests/test_sdk_python_collection.py index 719f6f7b..c2b2f6f3 100644 --- a/test_collections/sdk_tests/support/tests/python_tests/test_sdk_python_collection.py +++ b/test_collections/matter/sdk_tests/support/tests/python_tests/test_sdk_python_collection.py @@ -20,24 +20,20 @@ import pytest -from test_collections.sdk_tests.support.models.sdk_test_folder import SDKTestFolder -from test_collections.sdk_tests.support.python_testing.models.python_test_models import ( - MatterTestType, -) -from test_collections.sdk_tests.support.python_testing.models.test_declarations import ( +from ...models.sdk_test_folder import SDKTestFolder +from ...python_testing.models.python_test_models import MatterTestType +from ...python_testing.models.test_declarations import ( PythonCaseDeclaration, PythonCollectionDeclaration, ) -from test_collections.sdk_tests.support.python_testing.sdk_python_tests import ( - sdk_python_test_collection, -) +from ...python_testing.sdk_python_tests import sdk_python_test_collection @pytest.fixture def python_test_collection() -> PythonCollectionDeclaration: test_sdk_python_path = Path(__file__).parent / "test_python_script" with mock.patch.object(Path, "exists", return_value=True), mock.patch( - "test_collections.sdk_tests.support.models.sdk_test_folder.open", + "test_collections.matter.sdk_tests.support.models.sdk_test_folder.open", new=mock.mock_open(read_data="unit-test-python-version"), ): folder = SDKTestFolder(path=test_sdk_python_path, filename_pattern="TC_*") diff --git a/test_collections/sdk_tests/support/tests/python_tests/test_utils.py b/test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py similarity index 93% rename from test_collections/sdk_tests/support/tests/python_tests/test_utils.py rename to test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py index 713f0188..8df32a14 100644 --- a/test_collections/sdk_tests/support/tests/python_tests/test_utils.py +++ b/test_collections/matter/sdk_tests/support/tests/python_tests/test_utils.py @@ -20,15 +20,16 @@ from app.default_environment_config import default_environment_config from app.schemas.test_environment_config import DutConfig, DutPairingModeEnum from app.test_engine.logger import test_engine_logger -from test_collections.sdk_tests.support.exec_run_in_container import ExecResultExtended -from test_collections.sdk_tests.support.python_testing.models.utils import ( + +from ...exec_run_in_container import ExecResultExtended +from ...python_testing.models.utils import ( EXECUTABLE, RUNNER_CLASS_PATH, DUTCommissioningError, commission_device, generate_command_arguments, ) -from test_collections.sdk_tests.support.sdk_container import SDKContainer +from ...sdk_container import SDKContainer @pytest.mark.asyncio @@ -213,11 +214,11 @@ async def test_commission_device() -> None: with mock.patch.object( target=sdk_container, attribute="send_command", return_value=mock_result ) as mock_send_command, mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.utils" + target="test_collections.matter.sdk_tests.support.python_testing.models.utils" ".generate_command_arguments", return_value=command_args, ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.utils" + target="test_collections.matter.sdk_tests.support.python_testing.models.utils" ".handle_logs" ) as mock_handle_logs, mock.patch.object( target=sdk_container, attribute="exec_exit_code", return_value=0 @@ -242,11 +243,11 @@ async def test_commission_device_failure() -> None: with mock.patch.object( target=sdk_container, attribute="send_command", return_value=mock_result ) as mock_send_command, mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.utils" + target="test_collections.matter.sdk_tests.support.python_testing.models.utils" ".generate_command_arguments", return_value=command_args, ), mock.patch( - target="test_collections.sdk_tests.support.python_testing.models.utils" + target="test_collections.matter.sdk_tests.support.python_testing.models.utils" ".handle_logs" ) as mock_handle_logs, mock.patch.object( target=sdk_container, attribute="exec_exit_code", return_value=1 diff --git a/test_collections/sdk_tests/support/tests/test_exec_run_in_container.py b/test_collections/matter/sdk_tests/support/tests/test_exec_run_in_container.py similarity index 95% rename from test_collections/sdk_tests/support/tests/test_exec_run_in_container.py rename to test_collections/matter/sdk_tests/support/tests/test_exec_run_in_container.py index c32997de..3589bed1 100644 --- a/test_collections/sdk_tests/support/tests/test_exec_run_in_container.py +++ b/test_collections/matter/sdk_tests/support/tests/test_exec_run_in_container.py @@ -16,9 +16,8 @@ from typing import Generator from app.tests.utils.docker import make_fake_container -from test_collections.sdk_tests.support.exec_run_in_container import ( - exec_run_in_container, -) + +from ..exec_run_in_container import exec_run_in_container def test_exec_run_in_container_not_stream() -> None: diff --git a/test_collections/sdk_tests/support/tests/test_sdk_container.py b/test_collections/matter/sdk_tests/support/tests/test_sdk_container.py similarity index 94% rename from test_collections/sdk_tests/support/tests/test_sdk_container.py rename to test_collections/matter/sdk_tests/support/tests/test_sdk_container.py index 69b83205..ef6ba195 100644 --- a/test_collections/sdk_tests/support/tests/test_sdk_container.py +++ b/test_collections/matter/sdk_tests/support/tests/test_sdk_container.py @@ -24,11 +24,9 @@ from app.container_manager import container_manager from app.core.config import settings from app.tests.utils.docker import make_fake_container -from test_collections.sdk_tests.support.exec_run_in_container import ExecResultExtended -from test_collections.sdk_tests.support.sdk_container import ( - SDKContainer, - SDKContainerNotRunning, -) + +from ..exec_run_in_container import ExecResultExtended +from ..sdk_container import SDKContainer, SDKContainerNotRunning @pytest.mark.asyncio @@ -155,7 +153,10 @@ async def test_send_command_default_prefix() -> None: attribute="create_container", return_value=fake_container, ), mock.patch( - target="test_collections.sdk_tests.support.sdk_container.exec_run_in_container", + target=( + "test_collections.matter.sdk_tests.support.sdk_container" + ".exec_run_in_container" + ), return_value=mock_result, ) as mock_exec_run: await sdk_container.start() @@ -193,7 +194,10 @@ async def test_send_command_custom_prefix() -> None: attribute="create_container", return_value=fake_container, ), mock.patch( - target="test_collections.sdk_tests.support.sdk_container.exec_run_in_container", + target=( + "test_collections.matter.sdk_tests.support.sdk_container" + ".exec_run_in_container" + ), return_value=mock_result, ) as mock_exec_run: await sdk_container.start() diff --git a/test_collections/matter/sdk_tests/support/tests/yaml_tests/__init__.py b/test_collections/matter/sdk_tests/support/tests/yaml_tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_chip_suite.py b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_chip_suite.py similarity index 97% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_chip_suite.py rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_chip_suite.py index 5538d825..2b9ce5ab 100644 --- a/test_collections/sdk_tests/support/tests/yaml_tests/test_chip_suite.py +++ b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_chip_suite.py @@ -23,12 +23,13 @@ from app.models.test_suite_execution import TestSuiteExecution from app.user_prompt_support.constants import UserResponseStatusEnum from app.user_prompt_support.prompt_response import PromptResponse -from test_collections.sdk_tests.support.yaml_tests.models.chip_suite import ( + +from ...yaml_tests.models.chip_suite import ( ChipSuite, DUTCommissioningError, SuiteSetupError, ) -from test_collections.sdk_tests.support.yaml_tests.models.chip_test import PromptOption +from ...yaml_tests.models.chip_test import PromptOption RETRY_PROMPT_RESPONSE = PromptResponse( response=PromptOption.RETRY, status_code=UserResponseStatusEnum.OKAY diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_sdk_yaml_collection.py b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_sdk_yaml_collection.py similarity index 88% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_sdk_yaml_collection.py rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_sdk_yaml_collection.py index 3f67d063..de847dfa 100644 --- a/test_collections/sdk_tests/support/tests/yaml_tests/test_sdk_yaml_collection.py +++ b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_sdk_yaml_collection.py @@ -18,22 +18,20 @@ import pytest -from test_collections.sdk_tests.support.models.matter_test_models import MatterTestType -from test_collections.sdk_tests.support.models.sdk_test_folder import SDKTestFolder -from test_collections.sdk_tests.support.yaml_tests.models.test_declarations import ( +from ...models.matter_test_models import MatterTestType +from ...models.sdk_test_folder import SDKTestFolder +from ...yaml_tests.models.test_declarations import ( YamlCaseDeclaration, YamlCollectionDeclaration, ) -from test_collections.sdk_tests.support.yaml_tests.sdk_yaml_tests import ( - sdk_yaml_test_collection, -) +from ...yaml_tests.sdk_yaml_tests import sdk_yaml_test_collection @pytest.fixture def yaml_collection() -> YamlCollectionDeclaration: test_sdk_yaml_path = Path(__file__).parent / "test_yamls" with mock.patch.object(Path, "exists", return_value=True), mock.patch( - "test_collections.sdk_tests.support.models.sdk_test_folder.open", + "test_collections.matter.sdk_tests.support.models.sdk_test_folder.open", new=mock.mock_open(read_data="unit-test-yaml-version"), ): folder = SDKTestFolder( diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_test_case.py b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_case.py similarity index 96% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_test_case.py rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_case.py index 3b282fc9..0721bed6 100644 --- a/test_collections/sdk_tests/support/tests/yaml_tests/test_test_case.py +++ b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_case.py @@ -22,22 +22,18 @@ from app.models.test_case_execution import TestCaseExecution from app.test_engine.logger import test_engine_logger from app.test_engine.models.manual_test_case import ManualVerificationTestStep -from test_collections.sdk_tests.support.chip.chip_tool import ChipTestType -from test_collections.sdk_tests.support.models.matter_test_models import ( - MatterTestStep, - MatterTestType, -) -from test_collections.sdk_tests.support.yaml_tests.models import YamlTestCase -from test_collections.sdk_tests.support.yaml_tests.models.chip_test import TestError -from test_collections.sdk_tests.support.yaml_tests.models.test_case import ( + +from ...chip.chip_tool import ChipTestType +from ...models.matter_test_models import MatterTestStep, MatterTestType +from ...yaml_tests.models import YamlTestCase +from ...yaml_tests.models.chip_test import TestError +from ...yaml_tests.models.test_case import ( YamlChipTestCase, YamlManualTestCase, YamlSemiAutomatedChipTestCase, YamlSimulatedTestCase, ) -from test_collections.sdk_tests.support.yaml_tests.models.yaml_test_models import ( - YamlTest, -) +from ...yaml_tests.models.yaml_test_models import YamlTest def yaml_test_instance( diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_test_declarations.py b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_declarations.py similarity index 81% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_test_declarations.py rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_declarations.py index 7aa8ce5e..37658fcb 100644 --- a/test_collections/sdk_tests/support/tests/yaml_tests/test_test_declarations.py +++ b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_declarations.py @@ -15,14 +15,12 @@ # from unittest import mock -from test_collections.sdk_tests.support.yaml_tests.models.test_declarations import ( +from ...yaml_tests.models.test_declarations import ( YamlCaseDeclaration, YamlSuiteDeclaration, ) -from test_collections.sdk_tests.support.yaml_tests.models.test_suite import SuiteType -from test_collections.sdk_tests.support.yaml_tests.models.yaml_test_models import ( - YamlTest, -) +from ...yaml_tests.models.test_suite import SuiteType +from ...yaml_tests.models.yaml_test_models import YamlTest def test_yaml_suite_declaration() -> None: @@ -31,7 +29,7 @@ def test_yaml_suite_declaration() -> None: version = "SomeVersionStr" with mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models." + "test_collections.matter.sdk_tests.support.yaml_tests.models." "test_suite.YamlTestSuite.class_factory" ) as class_factory, mock.patch( "app.test_engine.models.test_declarations.TestSuiteDeclaration.__init__" @@ -47,7 +45,7 @@ def test_yaml_case_declaration() -> None: test = YamlTest(name="TestTest", config={}, tests=[]) version = "SomeVersionStr" with mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models." + "test_collections.matter.sdk_tests.support.yaml_tests.models." "test_case.YamlTestCase.class_factory" ) as class_factory, mock.patch( "app.test_engine.models.test_declarations.TestCaseDeclaration.__init__" diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_test_suite.py b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_suite.py similarity index 91% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_test_suite.py rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_suite.py index 92d7ca08..539ca044 100644 --- a/test_collections/sdk_tests/support/tests/yaml_tests/test_test_suite.py +++ b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_test_suite.py @@ -20,8 +20,9 @@ from app.models.test_suite_execution import TestSuiteExecution from app.test_engine.logger import test_engine_logger -from test_collections.sdk_tests.support.chip.chip_tool import ChipTestType -from test_collections.sdk_tests.support.yaml_tests.models.test_suite import ( + +from ...chip.chip_tool import ChipTestType +from ...yaml_tests.models.test_suite import ( ChipYamlTestSuite, ManualYamlTestSuite, SimulatedYamlTestSuite, @@ -107,8 +108,8 @@ async def test_suite_setup_log_yaml_version() -> None: with mock.patch.object( target=test_engine_logger, attribute="info" ) as logger_info, mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models.chip_suite.ChipSuite" - ".setup" + "test_collections.matter.sdk_tests.support.yaml_tests.models.chip_suite" + ".ChipSuite.setup" ) as _: await suite_instance.setup() logger_info.assert_called() @@ -128,10 +129,10 @@ async def test_manual_suite_setup_cleanup() -> None: with mock.patch.object( target=test_engine_logger, attribute="info" ) as logger_info, mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models." + "test_collections.matter.sdk_tests.support.yaml_tests.models." "test_suite.YamlTestSuite.setup" ) as _, mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models." + "test_collections.matter.sdk_tests.support.yaml_tests.models." "test_suite.YamlTestSuite.cleanup" ) as _: await suite_instance.setup() @@ -157,11 +158,11 @@ async def test_chip_suite_setup() -> None: suite_instance = suite_class(TestSuiteExecution()) with mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models." + "test_collections.matter.sdk_tests.support.yaml_tests.models." "test_suite.YamlTestSuite.setup" ) as yaml_suite_setup, mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models.chip_suite.ChipSuite" - ".setup" + "test_collections.matter.sdk_tests.support.yaml_tests.models.chip_suite" + ".ChipSuite.setup" ) as chip_suite_setup: await suite_instance.setup() yaml_suite_setup.assert_called_once() diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yaml_folder.py b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yaml_folder.py similarity index 92% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yaml_folder.py rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yaml_folder.py index 160c537e..496fcd31 100644 --- a/test_collections/sdk_tests/support/tests/yaml_tests/test_yaml_folder.py +++ b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yaml_folder.py @@ -16,7 +16,7 @@ from pathlib import Path from unittest import mock -from test_collections.sdk_tests.support.models.sdk_test_folder import SDKTestFolder +from ...models.sdk_test_folder import SDKTestFolder test_yaml_path = Path("/test/yaml") @@ -27,7 +27,7 @@ def test_yaml_folder_version() -> None: # We mock open to read version_file_content and Path exists to ignore that we're # testing with a fake path with mock.patch( - "test_collections.sdk_tests.support.models.sdk_test_folder.open", + "test_collections.matter.sdk_tests.support.models.sdk_test_folder.open", new=mock.mock_open(read_data=version_file_content), ), mock.patch.object(target=Path, attribute="exists", return_value=True) as _: yaml_folder = SDKTestFolder(test_yaml_path) diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yaml_parser.py b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yaml_parser.py similarity index 90% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yaml_parser.py rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yaml_parser.py index df9ae054..cfd11679 100644 --- a/test_collections/sdk_tests/support/tests/yaml_tests/test_yaml_parser.py +++ b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yaml_parser.py @@ -19,14 +19,9 @@ import pytest from pydantic.error_wrappers import ValidationError -from test_collections.sdk_tests.support.models.matter_test_models import ( - MatterTestStep, - MatterTestType, -) -from test_collections.sdk_tests.support.tests.yaml_tests.test_test_case import ( - yaml_test_instance, -) -from test_collections.sdk_tests.support.yaml_tests.models.yaml_test_parser import ( +from ...models.matter_test_models import MatterTestStep, MatterTestType +from ...tests.yaml_tests.test_test_case import yaml_test_instance +from ...yaml_tests.models.yaml_test_parser import ( YamlParserException, YamlTest, _test_type, @@ -62,7 +57,10 @@ def test_yaml_file_parser_throws_validationexception() -> None: mock_validation = ValidationError(errors=[mock.MagicMock()], model=mock.MagicMock()) with mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models.yaml_test_parser.open", + ( + "test_collections.matter.sdk_tests.support.yaml_tests.models" + ".yaml_test_parser.open" + ), new=mock.mock_open(read_data=sample_yaml_file_content), ), mock.patch( "loguru.logger", @@ -89,7 +87,10 @@ def test_yaml_file_parser() -> None: # We mock builtin `open` method to read sample yaml file content, # to avoid having to load a real file. with mock.patch( - "test_collections.sdk_tests.support.yaml_tests.models.yaml_test_parser.open", + ( + "test_collections.matter.sdk_tests.support.yaml_tests.models" + ".yaml_test_parser.open" + ), new=mock.mock_open(read_data=sample_yaml_file_content), ) as file_open: test = parse_yaml_test(file_path) diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACE_1_2_Manual.yaml b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACE_1_2_Manual.yaml similarity index 100% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACE_1_2_Manual.yaml rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACE_1_2_Manual.yaml diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_1_1_Automated.yaml b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_1_1_Automated.yaml similarity index 100% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_1_1_Automated.yaml rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_1_1_Automated.yaml diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_1_Automated.yaml b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_1_Automated.yaml similarity index 100% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_1_Automated.yaml rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_1_Automated.yaml diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_2_Semi_Automated.yaml b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_2_Semi_Automated.yaml similarity index 100% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_2_Semi_Automated.yaml rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_2_Semi_Automated.yaml diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_3_Incomplete.yaml b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_3_Incomplete.yaml similarity index 100% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_3_Incomplete.yaml rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_3_Incomplete.yaml diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_5_Manual.yml b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_5_Manual.yml similarity index 100% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_5_Manual.yml rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_ACL_2_5_Manual.yml diff --git a/test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_BINFO_2_3_Simulated.yaml b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_BINFO_2_3_Simulated.yaml similarity index 100% rename from test_collections/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_BINFO_2_3_Simulated.yaml rename to test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/UnitTest_TC_BINFO_2_3_Simulated.yaml diff --git a/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/other_file_to_be_ignored.yaml b/test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yamls/other_file_to_be_ignored.yaml new file mode 100644 index 00000000..e69de29b diff --git a/test_collections/sdk_tests/support/utils.py b/test_collections/matter/sdk_tests/support/utils.py similarity index 100% rename from test_collections/sdk_tests/support/utils.py rename to test_collections/matter/sdk_tests/support/utils.py diff --git a/test_collections/sdk_tests/support/yaml_tests/__init__.py b/test_collections/matter/sdk_tests/support/yaml_tests/__init__.py similarity index 100% rename from test_collections/sdk_tests/support/yaml_tests/__init__.py rename to test_collections/matter/sdk_tests/support/yaml_tests/__init__.py diff --git a/test_collections/sdk_tests/support/yaml_tests/models/__init__.py b/test_collections/matter/sdk_tests/support/yaml_tests/models/__init__.py similarity index 100% rename from test_collections/sdk_tests/support/yaml_tests/models/__init__.py rename to test_collections/matter/sdk_tests/support/yaml_tests/models/__init__.py diff --git a/test_collections/sdk_tests/support/yaml_tests/models/chip_suite.py b/test_collections/matter/sdk_tests/support/yaml_tests/models/chip_suite.py similarity index 97% rename from test_collections/sdk_tests/support/yaml_tests/models/chip_suite.py rename to test_collections/matter/sdk_tests/support/yaml_tests/models/chip_suite.py index 85d778b8..ddb08dc9 100644 --- a/test_collections/sdk_tests/support/yaml_tests/models/chip_suite.py +++ b/test_collections/matter/sdk_tests/support/yaml_tests/models/chip_suite.py @@ -26,10 +26,11 @@ from app.test_engine.models import TestSuite from app.user_prompt_support.prompt_request import OptionsSelectPromptRequest from app.user_prompt_support.user_prompt_support import UserPromptSupport -from test_collections.sdk_tests.support.chip import ChipTool -from test_collections.sdk_tests.support.chip.chip_tool import ChipTestType -from test_collections.sdk_tests.support.sdk_container import SDKContainer -from test_collections.sdk_tests.support.yaml_tests.models.chip_test import PromptOption + +from ...chip import ChipTool +from ...chip.chip_tool import ChipTestType +from ...sdk_container import SDKContainer +from ...yaml_tests.models.chip_test import PromptOption CHIP_APP_PAIRING_CODE = "CHIP:SVR: Manual pairing code:" diff --git a/test_collections/sdk_tests/support/yaml_tests/models/chip_test.py b/test_collections/matter/sdk_tests/support/yaml_tests/models/chip_test.py similarity index 98% rename from test_collections/sdk_tests/support/yaml_tests/models/chip_test.py rename to test_collections/matter/sdk_tests/support/yaml_tests/models/chip_test.py index 1999d937..2c3a5186 100644 --- a/test_collections/sdk_tests/support/yaml_tests/models/chip_test.py +++ b/test_collections/matter/sdk_tests/support/yaml_tests/models/chip_test.py @@ -34,9 +34,10 @@ from app.user_prompt_support.uploaded_file_support import UploadFile from app.user_prompt_support.user_prompt_manager import user_prompt_manager from app.user_prompt_support.user_prompt_support import UserPromptSupport -from test_collections.sdk_tests.support.chip import ChipTool -from test_collections.sdk_tests.support.chip.chip_tool import ChipTestType -from test_collections.sdk_tests.support.sdk_container import SDKContainer + +from ...chip import ChipTool +from ...chip.chip_tool import ChipTestType +from ...sdk_container import SDKContainer CHIP_TOOL_DEFAULT_PROMPT_TIMEOUT_S = 60 # seconds OUTCOME_TIMEOUT_S = 60 * 10 # Seconds diff --git a/test_collections/sdk_tests/support/yaml_tests/models/test_case.py b/test_collections/matter/sdk_tests/support/yaml_tests/models/test_case.py similarity index 96% rename from test_collections/sdk_tests/support/yaml_tests/models/test_case.py rename to test_collections/matter/sdk_tests/support/yaml_tests/models/test_case.py index eadfee43..982c4ac2 100644 --- a/test_collections/sdk_tests/support/yaml_tests/models/test_case.py +++ b/test_collections/matter/sdk_tests/support/yaml_tests/models/test_case.py @@ -24,16 +24,10 @@ TestStep, ) from app.test_engine.models.test_case import CUSTOM_TEST_IDENTIFIER -from test_collections.sdk_tests.support.chip.chip_tool import ChipTestType -from test_collections.sdk_tests.support.models.matter_test_models import ( - MatterTestStep, - MatterTestType, -) -from test_collections.sdk_tests.support.yaml_tests.models.chip_test import ( - ChipManualPromptTest, - ChipTest, -) +from ...chip.chip_tool import ChipTestType +from ...models.matter_test_models import MatterTestStep, MatterTestType +from ...yaml_tests.models.chip_test import ChipManualPromptTest, ChipTest from .yaml_test_models import YamlTest # Custom type variable used to annotate the factory method in YamlTestCase. diff --git a/test_collections/sdk_tests/support/yaml_tests/models/test_declarations.py b/test_collections/matter/sdk_tests/support/yaml_tests/models/test_declarations.py similarity index 91% rename from test_collections/sdk_tests/support/yaml_tests/models/test_declarations.py rename to test_collections/matter/sdk_tests/support/yaml_tests/models/test_declarations.py index fbe36139..8557b520 100644 --- a/test_collections/sdk_tests/support/yaml_tests/models/test_declarations.py +++ b/test_collections/matter/sdk_tests/support/yaml_tests/models/test_declarations.py @@ -20,9 +20,9 @@ TestCollectionDeclaration, TestSuiteDeclaration, ) -from test_collections.sdk_tests.support.models.matter_test_models import MatterTestType -from test_collections.sdk_tests.support.models.sdk_test_folder import SDKTestFolder +from ...models.matter_test_models import MatterTestType +from ...models.sdk_test_folder import SDKTestFolder from .test_case import YamlTestCase from .test_suite import SuiteType, YamlTestSuite from .yaml_test_models import YamlTest diff --git a/test_collections/sdk_tests/support/yaml_tests/models/test_suite.py b/test_collections/matter/sdk_tests/support/yaml_tests/models/test_suite.py similarity index 95% rename from test_collections/sdk_tests/support/yaml_tests/models/test_suite.py rename to test_collections/matter/sdk_tests/support/yaml_tests/models/test_suite.py index c815a69e..374ddccd 100644 --- a/test_collections/sdk_tests/support/yaml_tests/models/test_suite.py +++ b/test_collections/matter/sdk_tests/support/yaml_tests/models/test_suite.py @@ -18,8 +18,9 @@ from app.test_engine.logger import test_engine_logger as logger from app.test_engine.models import TestSuite -from test_collections.sdk_tests.support.chip.chip_tool import ChipTestType -from test_collections.sdk_tests.support.yaml_tests.models.chip_suite import ChipSuite + +from ...chip.chip_tool import ChipTestType +from ...yaml_tests.models.chip_suite import ChipSuite class YamlTestSuiteFactoryError(Exception): diff --git a/test_collections/sdk_tests/support/yaml_tests/models/yaml_test_models.py b/test_collections/matter/sdk_tests/support/yaml_tests/models/yaml_test_models.py similarity index 100% rename from test_collections/sdk_tests/support/yaml_tests/models/yaml_test_models.py rename to test_collections/matter/sdk_tests/support/yaml_tests/models/yaml_test_models.py diff --git a/test_collections/sdk_tests/support/yaml_tests/models/yaml_test_parser.py b/test_collections/matter/sdk_tests/support/yaml_tests/models/yaml_test_parser.py similarity index 96% rename from test_collections/sdk_tests/support/yaml_tests/models/yaml_test_parser.py rename to test_collections/matter/sdk_tests/support/yaml_tests/models/yaml_test_parser.py index f4275660..04688589 100644 --- a/test_collections/sdk_tests/support/yaml_tests/models/yaml_test_parser.py +++ b/test_collections/matter/sdk_tests/support/yaml_tests/models/yaml_test_parser.py @@ -18,8 +18,7 @@ from loguru import logger from pydantic import ValidationError -from test_collections.sdk_tests.support.models.matter_test_models import MatterTestType - +from ...models.matter_test_models import MatterTestType from .yaml_test_models import YamlTest diff --git a/test_collections/sdk_tests/support/yaml_tests/sdk_yaml_tests.py b/test_collections/matter/sdk_tests/support/yaml_tests/sdk_yaml_tests.py similarity index 95% rename from test_collections/sdk_tests/support/yaml_tests/sdk_yaml_tests.py rename to test_collections/matter/sdk_tests/support/yaml_tests/sdk_yaml_tests.py index 98e60341..75aedc08 100644 --- a/test_collections/sdk_tests/support/yaml_tests/sdk_yaml_tests.py +++ b/test_collections/matter/sdk_tests/support/yaml_tests/sdk_yaml_tests.py @@ -18,10 +18,9 @@ from loguru import logger -from test_collections.sdk_tests.support.models.matter_test_models import MatterTestType -from test_collections.sdk_tests.support.models.sdk_test_folder import SDKTestFolder -from test_collections.sdk_tests.support.paths import SDK_CHECKOUT_PATH - +from ..models.matter_test_models import MatterTestType +from ..models.sdk_test_folder import SDKTestFolder +from ..paths import SDK_CHECKOUT_PATH from .models.test_declarations import ( YamlCaseDeclaration, YamlCollectionDeclaration, diff --git a/test_collections/python_tests b/test_collections/python_tests deleted file mode 160000 index 8b20f355..00000000 --- a/test_collections/python_tests +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8b20f355c52a0bb9a154ef79e9859cac5546fbb1 diff --git a/test_collections/tool_unit_tests/test_suite_chip/tctr_chip_log_parsing/tctr_chip_log_parsing.py b/test_collections/tool_unit_tests/test_suite_chip/tctr_chip_log_parsing/tctr_chip_log_parsing.py index 626b11ae..f74bc733 100644 --- a/test_collections/tool_unit_tests/test_suite_chip/tctr_chip_log_parsing/tctr_chip_log_parsing.py +++ b/test_collections/tool_unit_tests/test_suite_chip/tctr_chip_log_parsing/tctr_chip_log_parsing.py @@ -17,8 +17,10 @@ from app.schemas.test_environment_config import TestEnvironmentConfig from app.test_engine.logger import test_engine_logger as logger from app.test_engine.models import TestStep -from test_collections.sdk_tests.support.chip.chip_tool import ChipTestType -from test_collections.sdk_tests.support.yaml_tests.models.chip_test import ChipTest +from test_collections.matter.sdk_tests.support.chip.chip_tool import ChipTestType +from test_collections.matter.sdk_tests.support.yaml_tests.models.chip_test import ( + ChipTest, +) class TCTRChipLogParsing(ChipTest):