Skip to content

Commit

Permalink
Copy XML data model files from SDK (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccruzagralopes authored Jan 5, 2024
1 parent 089e1d1 commit 0ae25e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ TMP_SDK_PATH="/tmp/$TMP_SDK_FOLDER"

SDK_YAML_PATH="src/app/tests/suites/certification"
SDK_PYTHON_SCRIPT_PATH="src/python_testing"
SDK_PYTHON_DATA_MODEL_PATH="data_model"
SDK_SCRIPTS_PATH="scripts/"
SDK_EXAMPLE_CHIP_TOOL_PATH="examples/chip-tool"
SDK_EXAMPLE_PLACEHOLDER_PATH="examples/placeholder"
Expand Down Expand Up @@ -107,7 +108,7 @@ then
git clone --filter=blob:none --no-checkout --depth 1 --sparse https://github.com/project-chip/connectedhomeip.git $TMP_SDK_FOLDER
cd $TMP_SDK_FOLDER
git sparse-checkout init
git sparse-checkout set $SDK_YAML_PATH $SDK_SCRIPTS_PATH $SDK_EXAMPLE_PLACEHOLDER_PATH $SDK_EXAMPLE_CHIP_TOOL_PATH $SDK_DATA_MODEL_PATH $SDK_PYTHON_SCRIPT_PATH
git sparse-checkout set $SDK_YAML_PATH $SDK_SCRIPTS_PATH $SDK_EXAMPLE_PLACEHOLDER_PATH $SDK_EXAMPLE_CHIP_TOOL_PATH $SDK_DATA_MODEL_PATH $SDK_PYTHON_SCRIPT_PATH $SDK_PYTHON_DATA_MODEL_PATH
git checkout -q $SDK_SHA
SDK_PATH="$TMP_SDK_PATH"
fi
Expand Down Expand Up @@ -137,6 +138,11 @@ cp * "$SDK_YAML_DIR_YAML_TEST_COLLECTION_PATH/"
cd "$SDK_PATH/$SDK_PYTHON_SCRIPT_PATH"
cp -R * "$PYTHON_TESTING_SCRIPTS_TEST_COLLECTION_PATH/"

# Copy XML data models for SDK Python Testing
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"
Expand Down
6 changes: 4 additions & 2 deletions test_collections/sdk_tests/support/chip/chip_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
# Python Testing Folder
LOCAL_TEST_COLLECTIONS_PATH = "/home/ubuntu/certification-tool/backend/test_collections"
LOCAL_PYTHON_TESTING_PATH = Path(
LOCAL_TEST_COLLECTIONS_PATH + "/sdk_tests/sdk_checkout/python_testing/scripts/sdk"
LOCAL_TEST_COLLECTIONS_PATH + "/sdk_tests/sdk_checkout/python_testing"
)
DOCKER_PYTHON_TESTING_PATH = "/root/python_testing"

Expand All @@ -115,7 +115,9 @@
LOCAL_TEST_COLLECTIONS_PATH + "/sdk_tests/support/python_testing/models/rpc_client/"
"test_harness_client.py"
)
DOCKER_RPC_PYTHON_TESTING_PATH = "/root/python_testing/test_harness_client.py"
DOCKER_RPC_PYTHON_TESTING_PATH = (
"/root/python_testing/scripts/sdk/test_harness_client.py"
)


# Docker Network
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ class TestRunnerHooks:


def main() -> None:
# Load python_testing as a module. This folder is where all python script is located
sys.path.append("/root/python_testing")
# Load python_testing/scripts/sdk as a module. This folder is where all python
# script are located
sys.path.append("/root/python_testing/scripts/sdk")

test_args = sys.argv[2:]
config = parse_matter_test_args(test_args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from test_collections.sdk_tests.support.chip import ChipTool

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


Expand Down

0 comments on commit 0ae25e7

Please sign in to comment.