Skip to content

Commit 9e0dc92

Browse files
rquiduteantonio-amjrhiltonlimaccruzagralopesswan-amazon
authored
Merge v2.13+summer2025 into main (project-chip#250)
* Updated SDK SHA - revert * Changed SDK_DOCKER_TAG to f2e5de7_latest * Make all TH dependencies not static (project-chip#164) * Updated package-dependency-list.txt * Updated missing dependencies * [FIX] Reverting the OTBR Start Script (project-chip#150) * Reverting the BR_VARIANT option to the otbr start script * Adding TODO to the script * Adding missing comment char * Updating Script Comment Year Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Adding switch parameters options to the script --------- Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Do not error while parsing SDK python tests (project-chip#141) * replace erro with warning * Update test_collections/matter/sdk_tests/support/python_testing/models/python_test_parser.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * black error fix * pr review --------- Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Add TC-IDM-10.5 test case to mandatory suite (project-chip#153) * Check user prompt answer FAILED for DUT commissioning (project-chip#155) * Handle Skip test fir old script python test cases (project-chip#154) * [FIX] Intermittent Tests Start Error With No Information (project-chip#157) * Fixing intermittent problem with Python's Base Manager Creating the manager now only once in the SDK Container Init * Refactoring and updating the unit tests with related mocks * Update python_testing references after SDK refactoring (project-chip#162) * Updated python_testing references after sdk refactoring * Removed no wanted file changes * Updated matter_testing references * Fixed line too long * Fixed code - black * Updated SDK SHA * Removed commented code * Revert "[FIX] Intermittent Tests Start Error With No Information (project-chip#157)" (project-chip#166) This reverts commit 316a934. * 01 - Isolate SDK docker pull script (project-chip#142) * Isolate SDK docker pull script * Changes after code review --------- Co-authored-by: Romulo Quidute Filho <rquidute@apple.com> * 02 - Script to parser SDK python tests (project-chip#144) * Isolate SDK docker pull script * Rebasing * Apply suggestions from code review Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Move call tp update-pull-sdk-docker-image.sh from setup.sh to update-sample-apps.sh * Changes after code review * Fixed CI issues * Code review fixes * Fixed unit tests * Fixed mypy --------- Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> Co-authored-by: Romulo Quidute Filho <rquidute@apple.com> * Implemented changes for custom python test (project-chip#167) * Implemented changes for custom python test * code review * Code review * Code reviewd * Fixed code violations * Chanegs after code review * Remove unused import * Update update-sample-app script to copy apps from new origin (project-chip#148) * Fix suite names for custom python tests (project-chip#168) * Fix move update-pull-sdk-docker-image script content to update-sample-app script (project-chip#169) * Fixed some python tests not listed (project-chip#172) * Fixed some python tests not listed * code review * [Feature] Implement support to export project config (project-chip#171) * Implement support to export project config * Fix mypy * Changed the returned schema and service endpoint name * Added import project config * Apply suggestions from code review Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * code review --------- Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * [FIX] Added support to negated PICS (project-chip#170) * Added support to negated PICS * Fixed flake * Code review. No consider negatives PICS * Update app/pics_applicable_test_cases.py * Code review * Fixes after merge * Remove unused file (project-chip#175) * Remove unused file * Updated cspell * Fix ci issues v 2 12 (project-chip#176) * Fix CI issues from v2.12 branch * Fixed merge * Fix test case * Updated SDK_DOCKER_IMAGE url * Updated SDK_DOCKER_IMAGE url * Add support for configuring terms and conditions in device commissioning (project-chip#173) * Add support for configuring terms and conditions in device commissioning This commit introduces a new `enhanced_setup_flow` configuration property to the test harness backend, allowing device manufacturers to define the terms and conditions (T&C) that must be acknowledged and set during device commissioning. These values are critical for supporting the Terms and Conditions Certification Test Suite. Key changes include: - Added the `EnhancedSetupFlowConfig` class to `DutConfig`, which allows specifying the T&C version and user response required during commissioning. - Updated `generate_command_arguments` in `utils.py` to append the necessary arguments for T&C validation and the device's commissioning method. - Adjusted model validation to ensure the `enhanced_setup_flow` field is processed correctly within `DutConfig`. These changes ensure the test harness can enforce manufacturer-specific T&C values during the commissioning process, aligning with the broader requirements of T&C validation. * * Ran ./scripts/format.sh * Update test_collections/matter/test_environment_config.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update app/user_prompt_support/uploaded_file_support.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/performance_tests/utils.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/python_testing/models/utils.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/python_testing/models/utils.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/python_testing/__init__.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Revert changes to test_collections/matter/sdk_tests/support/performance_tests/utils.py * Restyle test_environment_config.py * test: Add in-test-commissioning-method parameter for manual commissioning validation Add new parameter to control commissioning flow during tests, allowing manual validation of the commissioning process instead of auto-commissioning. This enables test cases to verify terms and conditions acknowledgements during the commissioning flow. - Add in-test-commissioning-method parameter to test flags - Support manual commissioning flow validation - Enable testing of T&C acknowledgement scenarios * Add new field "enhanced_setup_flow" to exception message * Cherry-pick test_python_parser.py from origin/main * Cherry-pick python_test_parser.py from origin/main * Revert "Cherry-pick python_test_parser.py from origin/main" This reverts commit 5d65ce5. * Revert "Cherry-pick test_python_parser.py from origin/main" This reverts commit 2cd99b7. * Removed broken test `test_python_parser.py` * Revert "Removed broken test `test_python_parser.py`" This reverts commit 48c0e32. --------- Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * chore: upgrade Node.js from v18.x to v20.x (project-chip#177) Updated Node.js installation source from setup_18.x to setup_20.x to align with Ubuntu 22.04 base image requirements * [Feature] DO NOT require commissioning every test (project-chip#178) * First implementation * Implement prompt and copy files from/to contanier * Unit tests * Updated SKA SHA * Unit test typo fixes * Mypy flake8 fixes * Mypy fixes * Update test_collections/matter/sdk_tests/support/python_testing/models/utils.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/utils.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Code review * Review fixes * Remove unused import --------- Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Add logs for project config (project-chip#179) * Add logs for project config * Updated cspell.json * Update app/test_engine/test_runner.py Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Fixed unit test * Unit test * Unit test --------- Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Implement rename test run execution name (project-chip#180) * Fix the checking for storage-path (project-chip#183) * Revert code changes related to SDK path refactoring (project-chip#186) * Refatoring prompts for recommissioning (project-chip#187) * Refatoring prompts for recommissioning * flake8 fixes * Changes after code review * Revert "Utilities stress stability (project-chip#146)" (project-chip#188) * Revert "Utilities stress stability (project-chip#146)" This reverts commit 1e042fa. * Fixing wrong reverts * Fixing two more reverts * Remove commissioning information when running YAML scripts (project-chip#189) * Fix CONTAINER_TH_CLIENT_EXEC path (project-chip#191) * Fix CONTAINER_TH_CLIENT_EXEC path * Code formating * Updated SDK SHA and Python Tests JSON (project-chip#192) * Removed unused count field at test_case_metadata (project-chip#193) * Add apps folder when copying apps from container to host * Version v2.12-beta2+spring2025 * Version v2.12-beta3+spring2025 * Add apps folder when copying apps from container to host (project-chip#194) * Add apps folder when copying apps from container to host * Version v2.12-beta2+spring2025 * Version v2.12-beta2+spring2025 * [FIX] Updating Performance Files (project-chip#182) * Fixing the utils script, one calls and a import from the performance tests files * Fixing isort and cspell checks * Fixing Unit tests and removing unnecessary folder and file (jupyter) * Fix starting backend without internet access. (project-chip#184) * Remove unused file (project-chip#175) * Remove unused file * Updated cspell * [FIX] Updating Performance Files (project-chip#182) * Fixing the utils script, one calls and a import from the performance tests files * Fixing isort and cspell checks * Fixing Unit tests and removing unnecessary folder and file (jupyter) * Remove unused file (project-chip#175) * Remove unused file * Updated cspell * Fix ci issues v 2 12 (project-chip#176) * Fix CI issues from v2.12 branch * Fixed merge * Fix test case * Updated SDK_DOCKER_IMAGE url * Updated SDK_DOCKER_IMAGE url * Add nfc-thread pairing mode (project-chip#185) * Added nfc-thread pairing mode. This mode doesn't need a discriminator. * Changed after black * Unit tests fixes * Fixed code violations --------- Co-authored-by: Romulo Quidute Filho <rquidute@apple.com> * [Fix] Recommissioning Refactoring to V1.5 (project-chip#190) * Refatoring prompts for recommissioning (project-chip#187) * Refatoring prompts for recommissioning * flake8 fixes * Changes after code review * Remove commissioning information when running YAML scripts (project-chip#189) --------- Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Updating SDK SHA to 7d67dc904758bb68989596f401a843a31e81911d in config * Updated SDK SHA * Redo code changes related to SDK path refactoring (project-chip#198) * Redo code changes related to SDK path refactoring * Putting back is_detach argument * Fix unit test --------- Co-authored-by: Romulo Quidute Filho <rquidute@apple.cpom> * Updated SDK SHA and update-sample-apps.sh * Updated sdk sha * Undo changes in update-sample-apps.sh * Utilities stress stability (project-chip#146) * draft 1 * Update * Fixing error related to multiple commissioning executions + enhancing logs * total, readcommissionininfo and discovery plots * added PASE plot and percentiles * Update PoC with support to Utility screen. * Adding support to analytics + enhancing container interface to support detach option. * Added backend service to generate summary for logDisplay * Removed unsued code * Addes URL report in response for performance_summary endpoint * Minor fixes * Fixing util method for the repeat feature of the performance tests * Merge alembic heads * Cast project config * Update method according to merged changes * Make logs directory if it doesn't exist * Add performance-logs to .gitignore * Adding the Log Display web application scripts for install, uninstall, start and stop operations * Adding support to Python Virtual Environment for the LogDisplay app scripts, plus minor changes * Fixing the repeat test feature for regular tests with more than one iteration * Removing configuration option for log folder in the LogDisplay tool for easier UX in the cost of less flexibility * Force the creation of logs/ directory as well for the LogDisplay output folder * Updating scripts and log generation to use environment variables for paths * Changing the container's log output folder for path binded with host * Updating the start script's path of the LogDisplay * Disabling SIGINT trap from the start script so the python script inside receive the Ctrl+C interruption * Adjustments on simulator script + moving matter_qa to outside endpoint + handling stress script location * Fixing lint issues. * Fix lint * fix additional lint issues * lint * fixing migration issues * Removing unnecessary code. * update log display feature. * adjustments --------- Co-authored-by: Fabio Maia <fabio_maia@apple.com> Co-authored-by: Romulo Quidute Filho <rquidute@apple.com> Co-authored-by: Antonio Melo Jr <a_junior@apple.com> Co-authored-by: Carolina Lopes <ccruzagralopes@apple.com> * Updated SDK SHA * Update SDK SHA * New Json for beta1 summer2025 release * Updating Beta 2 For Summer 2025 (project-chip#200) * Updating the SDK SHA * Updating the sample apps script * Updating the version information file * Removing unnecessary Jupyter folder and file * Updating the python tests information json file * Solving python black issue for github checks * Updated SDK_SHA. ble-wifi and ble-thread fixes * Change to be able to use NFC Commissioning in YAML test. (project-chip#201) * chore: upgrade Node.js from v18.x to v20.x (project-chip#177) Updated Node.js installation source from setup_18.x to setup_20.x to align with Ubuntu 22.04 base image requirements * [FIX] Updating Performance Files (project-chip#182) * Fixing the utils script, one calls and a import from the performance tests files * Fixing isort and cspell checks * Fixing Unit tests and removing unnecessary folder and file (jupyter) * Fix starting backend without internet access. (project-chip#184) * Remove unused file (project-chip#175) * Remove unused file * Updated cspell * Add support for configuring terms and conditions in device commissioning (project-chip#173) * Add support for configuring terms and conditions in device commissioning This commit introduces a new `enhanced_setup_flow` configuration property to the test harness backend, allowing device manufacturers to define the terms and conditions (T&C) that must be acknowledged and set during device commissioning. These values are critical for supporting the Terms and Conditions Certification Test Suite. Key changes include: - Added the `EnhancedSetupFlowConfig` class to `DutConfig`, which allows specifying the T&C version and user response required during commissioning. - Updated `generate_command_arguments` in `utils.py` to append the necessary arguments for T&C validation and the device's commissioning method. - Adjusted model validation to ensure the `enhanced_setup_flow` field is processed correctly within `DutConfig`. These changes ensure the test harness can enforce manufacturer-specific T&C values during the commissioning process, aligning with the broader requirements of T&C validation. * * Ran ./scripts/format.sh * Update test_collections/matter/test_environment_config.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update app/user_prompt_support/uploaded_file_support.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/performance_tests/utils.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/python_testing/models/utils.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/python_testing/models/utils.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/python_testing/__init__.py Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Revert changes to test_collections/matter/sdk_tests/support/performance_tests/utils.py * Restyle test_environment_config.py * test: Add in-test-commissioning-method parameter for manual commissioning validation Add new parameter to control commissioning flow during tests, allowing manual validation of the commissioning process instead of auto-commissioning. This enables test cases to verify terms and conditions acknowledgements during the commissioning flow. - Add in-test-commissioning-method parameter to test flags - Support manual commissioning flow validation - Enable testing of T&C acknowledgement scenarios * Add new field "enhanced_setup_flow" to exception message * Cherry-pick test_python_parser.py from origin/main * Cherry-pick python_test_parser.py from origin/main * Revert "Cherry-pick python_test_parser.py from origin/main" This reverts commit 5d65ce5. * Revert "Cherry-pick test_python_parser.py from origin/main" This reverts commit 2cd99b7. * Removed broken test `test_python_parser.py` * Revert "Removed broken test `test_python_parser.py`" This reverts commit 48c0e32. --------- Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * [Feature] DO NOT require commissioning every test (project-chip#178) * First implementation * Implement prompt and copy files from/to contanier * Unit tests * Updated SKA SHA * Unit test typo fixes * Mypy flake8 fixes * Mypy fixes * Update test_collections/matter/sdk_tests/support/python_testing/models/utils.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Update test_collections/matter/sdk_tests/support/utils.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Code review * Review fixes * Remove unused import --------- Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Add logs for project config (project-chip#179) * Add logs for project config * Updated cspell.json * Update app/test_engine/test_runner.py Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Fixed unit test * Unit test * Unit test --------- Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Implement rename test run execution name (project-chip#180) * Fix the checking for storage-path (project-chip#183) * [FIX] Updating Performance Files (project-chip#182) * Fixing the utils script, one calls and a import from the performance tests files * Fixing isort and cspell checks * Fixing Unit tests and removing unnecessary folder and file (jupyter) * Remove unused file (project-chip#175) * Remove unused file * Updated cspell * Fix ci issues v 2 12 (project-chip#176) * Fix CI issues from v2.12 branch * Fixed merge * Fix test case * Updated SDK_DOCKER_IMAGE url * Updated SDK_DOCKER_IMAGE url * Add logs for project config (project-chip#179) * Add logs for project config * Updated cspell.json * Update app/test_engine/test_runner.py Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Fixed unit test * Unit test * Unit test --------- Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Add logs for project config (project-chip#179) * Add logs for project config * Updated cspell.json * Update app/test_engine/test_runner.py Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Fixed unit test * Unit test * Unit test --------- Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Add nfc-thread pairing mode (project-chip#185) * Added nfc-thread pairing mode. This mode doesn't need a discriminator. * Changed after black * Unit tests fixes * Fixed code violations --------- Co-authored-by: Romulo Quidute Filho <rquidute@apple.com> * Add logs for project config (project-chip#179) * Add logs for project config * Updated cspell.json * Update app/test_engine/test_runner.py Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * Fixed unit test * Unit test * Unit test --------- Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> * [Fix] Recommissioning Refactoring to V1.5 (project-chip#190) * Refatoring prompts for recommissioning (project-chip#187) * Refatoring prompts for recommissioning * flake8 fixes * Changes after code review * Remove commissioning information when running YAML scripts (project-chip#189) --------- Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> * Change to be able to use NFC Commissioning in YAML test. NB: Change for Python tests will be done in another PR. * Fixed the error found by black and Flake8. * Added comment --------- Co-authored-by: James Swan <122404367+swan-amazon@users.noreply.github.com> Co-authored-by: antonio-amjr <116589331+antonio-amjr@users.noreply.github.com> Co-authored-by: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> Co-authored-by: Romulo Quidute Filho <rquidute@apple.com> * [FIX] Removing Performance Collection From PICS Validation (project-chip#202) * Removing Performance collection from PICS applicable tests validation * Using a test collection copy instead of the original dict to prevent losing data * [FIX] Fix Custom YAML test execution (project-chip#205) * Fix Custom YAML test execution * Fixed flake8 and spellcheck * Update test_collections/matter/sdk_tests/support/yaml_tests/matter_yaml_runner.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> --------- Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Copy mock_server from cert-bins to host (project-chip#206) * Copy mock_server from cert-bins to host * Update test_collections/matter/scripts/update-sample-apps.sh Co-authored-by: antonio-amjr <116589331+antonio-amjr@users.noreply.github.com> * Updated SDK-SHA - 6cc5fb1 --------- Co-authored-by: antonio-amjr <116589331+antonio-amjr@users.noreply.github.com> * Implement Project config changes due to platform certification support (project-chip#207) * Allow Json file to be uploaded * Updated SDK SHA * Updated code to parser new dmp file format (xml) * Some code refinements and unit tests * Code review * Code review * Isort fix * [Feature] Platform cert implementation - Updated applicable test cases (project-chip#209) * Initial coding for platform certification support - applicable test cases * Implemented Derived product certification flow - PLAT_CERT_DONE = True * Added unit tests * Add TODO to fetch platform-test.json from connectedhome ip repo * Undo changed in config.py * Fix mypy flake8 * Update app/pics_applicable_test_cases.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Update app/pics_applicable_test_cases.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Update app/tests/pics/test_applicable_test_cases_list.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Update app/pics_applicable_test_cases.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Fixes after tests * Update app/pics_applicable_test_cases.py * Code review --------- Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Use discriminator for nfc thread (project-chip#212) * Use discriminator for nfc_thread pairing * Undo discriminator as optional * Code review * Added platform-test.json as ignorePaths for cspell.json * Updated SDK_SHA to c60643c9a44ff6dfcc4319588e6fdec544c4a3e2 * Updated .version_information file * [FIX] Adding Timeout To Server Exit (project-chip#216) * Adding a fail-safe mechanism when stopping the chip server after a test execution * Returning missing while condition and adding a delay of 5 seconds between new tries * Fixing the while condition again and adding a log to the sleep delay in the logic * Rewording comment * Updated SDK_SHA - added air-purifier app * updated version to v2.13-beta3.1+summer2025 * Fix 1.5_in_progress missing folder (project-chip#217) * Added logs for applicable test cases (project-chip#218) * Adding the missing parameter to avoid the python's posicional argument error (project-chip#219) * Updating .version_information of backend * Copying credentials folder from SDK image * Updating version information * Fixed some platform tests not being added to applicable test cases (project-chip#220) * Fixed some platform tests not being added to applicable test cases * Code review * mypy fix * Code review * Improve platform test selection * Update app/pics_applicable_test_cases.py Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> --------- Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> * Fix platform-test.json read path * [Fix] Linter Error (project-chip#221) * Fixing linter's long line error * Removing two failing unit tests from platform Added a TODO comment with an open issue to address this problem. * Fixing flake issues * Returning missing parameter for Platform invalid json Unit Test * Move platform-test.json to collections folder (project-chip#223) * Move platform-test.json to collections folder * Fixed unused import and unit tests * Changes for v2.13-beta4+summer2025 version (project-chip#224) * Changes for v2.13-beta4+summer2025 version * Updated path for platform-test.json file in cspell.json * Updated the affected sdk references (project-chip#226) * [Platform-Certification] Platform Certification List (project-chip#225) * Added the platform test list json and a Readme about the file in a folder in the repo root * Applying Gemini's comments * Moved the platform cert files to the matter folder * Update code due to platform test file location (project-chip#227) * Updated code after platform test location file is placed in new location * [Platform-Certification] Platform Certification List (project-chip#225) * Added the platform test list json and a Readme about the file in a folder in the repo root * Applying Gemini's comments * Moved the platform cert files to the matter folder * Fixed the right platform file path --------- Co-authored-by: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> * Updated python_tests (project-chip#228) * Updated SDK SHA and python_tests_info.json for v2.13-beta4+summer2025 * New endpoint for CLI execution - Simplify the process (project-chip#229) * create /cli endpoint * Changes for v2.13-beta4+summer2025 version (project-chip#224) * Changes for v2.13-beta4+summer2025 version * Updated path for platform-test.json file in cspell.json * Updated the affected sdk references (project-chip#226) * [Platform-Certification] Platform Certification List (project-chip#225) * Added the platform test list json and a Readme about the file in a folder in the repo root * Applying Gemini's comments * Moved the platform cert files to the matter folder * Update code due to platform test file location (project-chip#227) * Updated code after platform test location file is placed in new location * [Platform-Certification] Platform Certification List (project-chip#225) * Added the platform test list json and a Readme about the file in a folder in the repo root * Applying Gemini's comments * Moved the platform cert files to the matter folder * Fixed the right platform file path --------- Co-authored-by: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> * Updated python_tests (project-chip#228) * Updated SDK SHA and python_tests_info.json for v2.13-beta4+summer2025 * Add POST test_run_executions/cli * Remove unused code * Code review --------- Co-authored-by: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> * [FIX] Fix logic for platform tests selection (project-chip#230) * Fixed applicable test cases for platform test execution * Code formating * Fix the platform keys for PICS_PLAT_CERT and PICS_PLAT_CERT_DERIVED * Fixed mypy * Black fix * Updated version to v2.13-beta4.1+summer2025 * Minor changes * Fixed platform tests selection when no PICS were informed (project-chip#232) * Fixed platform tests selection when no PICS were informed * Balck and flake8 fixes * Minor code comment * [FIX] Make python script test name more flexible (project-chip#233) * Make python script test name more flexible * Add comment for the regex * Fix logix for platorm test selection (project-chip#234) * Revert "[FIX] Make python script test name more flexible (project-chip#233)" (project-chip#235) This reverts commit d1e207e. * Updating SDK SHA to 1b2b3fd, the version information and the Python tests json This is for the final version of v2.13+summer2025 (Matter 1.4.2) release --------- Co-authored-by: antonio-amjr <116589331+antonio-amjr@users.noreply.github.com> Co-authored-by: hiltonlima <116589806+hiltonlima@users.noreply.github.com> Co-authored-by: Carolina Lopes <116589288+ccruzagralopes@users.noreply.github.com> Co-authored-by: James Swan <122404367+swan-amazon@users.noreply.github.com> Co-authored-by: Olivier LORENTE [ST] <34505085+OlivierGre@users.noreply.github.com> Co-authored-by: Antonio Melo Jr. <a_junior@apple.com> Co-authored-by: Romulo Quidute Filho <rquidute@apple.cpom> Co-authored-by: gladystonfranca <117387464+gladystonfranca@users.noreply.github.com> Co-authored-by: Fabio Maia <fabio_maia@apple.com> Co-authored-by: Carolina Lopes <ccruzagralopes@apple.com> Co-authored-by: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com>
1 parent deb46e6 commit 9e0dc92

39 files changed

Lines changed: 17218 additions & 7317 deletions

.version_information

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.12+spring2025
1+
v2.13+summer2025

app/api/api_v1/endpoints/projects.py

Lines changed: 76 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
# limitations under the License.
1515
#
1616
import json
17+
import traceback
1718
from http import HTTPStatus
1819
from typing import List, Sequence, Union
1920

2021
from fastapi import APIRouter, Depends, File, HTTPException, Request, UploadFile
2122
from fastapi.encoders import jsonable_encoder
2223
from fastapi.responses import JSONResponse
24+
from loguru import logger
2325
from pydantic import ValidationError, parse_obj_as
2426
from sqlalchemy.orm import Session
2527
from sqlalchemy.orm.attributes import flag_modified
@@ -29,11 +31,16 @@
2931
from app.default_environment_config import default_environment_config
3032
from app.models.project import Project
3133
from app.pics.pics_parser import PICSParser
32-
from app.pics_applicable_test_cases import applicable_test_cases_list
34+
from app.pics_applicable_test_cases import applicable_test_cases_set
3335
from app.schemas.pics import PICSError
3436
from app.schemas.project import Project as Proj
3537
from app.schemas.test_environment_config import TestEnvironmentConfigError
36-
from app.utils import TEST_ENVIRONMENT_CONFIG_NAME
38+
from app.utils import (
39+
DMP_TEST_SKIP_CONFIG_NODE,
40+
DMP_TEST_SKIP_FILENAME,
41+
TEST_ENVIRONMENT_CONFIG_NAME,
42+
parse_dmp_file,
43+
)
3744

3845
router = APIRouter()
3946

@@ -226,32 +233,66 @@ def unarchive_project(
226233
return crud.project.unarchive(db=db, db_obj=__project(db=db, id=id))
227234

228235

236+
def __upload_pics(file: UploadFile, db: Session, project: Project) -> Project:
237+
cluster = PICSParser.parse(file=file.file)
238+
239+
project.pics.clusters[cluster.name] = cluster
240+
241+
return __persist_update_not_mutable(db=db, project=project, field="pics")
242+
243+
244+
def __persist_dmp_test_skip(file: UploadFile, db: Session, project: Project) -> Project:
245+
try:
246+
skip_test_list = parse_dmp_file(xml_file=file.file)
247+
project.config[DMP_TEST_SKIP_CONFIG_NODE] = skip_test_list
248+
249+
return __persist_update_not_mutable(db=db, project=project, field="config")
250+
except Exception:
251+
logger.error(traceback.format_exc())
252+
raise HTTPException(
253+
status_code=HTTPStatus.UNPROCESSABLE_ENTITY,
254+
detail=f"Not able to parse {file.filename} file",
255+
)
256+
257+
229258
@router.put("/{id}/upload_pics", response_model=schemas.Project)
230-
def upload_pics(
259+
async def upload_pics(
231260
*,
232261
db: Session = Depends(get_db),
233262
file: UploadFile = File(...),
234263
id: int,
235264
) -> models.Project:
236-
"""Upload PICS file of a project based on project identifier.
265+
"""Upload PICS or dmp-test-skip.xml file of a project based on project identifier.
237266
238267
Args:
239268
id (int): project id
240-
file : the PICS file to upload
269+
file : the PICS or dmp-test-skip.xml file to upload
241270
242271
Raises:
243272
HTTPException: if no project exists for provided project id (or)
244273
if the PICS file is invalid
245274
246275
Returns:
247-
Project: project record that was updated with the PICS information
276+
Project: project record that was updated with the PICS and dmp_test_skip
277+
information.
248278
"""
249-
cluster = PICSParser.parse(file=file.file)
250-
251279
project = __project(db=db, id=id)
252-
project.pics.clusters[cluster.name] = cluster
253280

254-
return __persist_pics_update(db=db, project=project)
281+
try:
282+
if file and file.filename and file.filename.startswith(DMP_TEST_SKIP_FILENAME):
283+
return __persist_dmp_test_skip(file=file, db=db, project=project)
284+
else:
285+
return __upload_pics(file=file, db=db, project=project)
286+
except PICSError as e:
287+
raise HTTPException(
288+
status_code=HTTPStatus.UNPROCESSABLE_ENTITY,
289+
detail=str(e),
290+
)
291+
except Exception as e:
292+
raise HTTPException(
293+
status_code=HTTPStatus.UNPROCESSABLE_ENTITY,
294+
detail=f"Not able to parse {file.filename} file: {str(e)}",
295+
)
255296

256297

257298
@router.delete("/{id}/pics_cluster_type", response_model=schemas.Project)
@@ -281,7 +322,7 @@ def remove_pics_cluster_type(
281322
# delete the PICS cluster.
282323
del project.pics.clusters[cluster_name]
283324

284-
return __persist_pics_update(db=db, project=project)
325+
return __persist_update_not_mutable(db=db, project=project, field="pics")
285326

286327

287328
@router.get(
@@ -307,7 +348,19 @@ def applicable_test_cases(
307348

308349
project_data = Proj.from_orm(project)
309350

310-
return applicable_test_cases_list(pics=project_data.pics)
351+
try:
352+
return applicable_test_cases_set(
353+
pics=project_data.pics,
354+
dmp_test_skip=project_data.config.get( # type: ignore
355+
DMP_TEST_SKIP_CONFIG_NODE, []
356+
),
357+
)
358+
except Exception as e:
359+
logger.error(f"Error getting applicable test cases: {str(e)}")
360+
raise HTTPException(
361+
status_code=HTTPStatus.UNPROCESSABLE_ENTITY,
362+
detail=f"Error getting applicable test cases: {str(e)}",
363+
)
311364

312365

313366
def __project(db: Session, id: int) -> Project:
@@ -319,16 +372,20 @@ def __project(db: Session, id: int) -> Project:
319372
return project
320373

321374

322-
def __persist_pics_update(db: Session, project: Project) -> Project:
323-
"""Update Project PICS in DB.
375+
def __persist_update_not_mutable(db: Session, project: Project, field: str) -> Project:
376+
"""Update Project JSON fields in DB.
324377
325-
project.pics is stored in a JSON column mapped to PICS schema, this column is
326-
not Mutable, so SQLAlchemy doesn't know when PICS changed.
378+
Project contains JSON columns (like 'pics' and 'config') mapped to their respective
379+
schemas.
380+
These columns are not Mutable by default, so SQLAlchemy doesn't track changes
381+
to their content.
327382
328-
Using `flag_modified` marks the property, so SQLAlchemy will update the field on
329-
commit.
383+
Using `flag_modified` explicitly marks the JSON property as changed, ensuring
384+
SQLAlchemy will update the field on commit. This is necessary for any nested
385+
modifications to JSON column data.
330386
"""
331-
flag_modified(project, "pics")
387+
388+
flag_modified(project, field)
332389
db.commit()
333390
db.refresh(project)
334391
return project

app/api/api_v1/endpoints/test_run_executions.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
from fastapi import APIRouter, BackgroundTasks, Depends, File, HTTPException, UploadFile
2121
from fastapi.encoders import jsonable_encoder
2222
from fastapi.responses import JSONResponse, StreamingResponse
23+
from loguru import logger
2324
from pydantic import ValidationError, parse_obj_as
2425
from sqlalchemy.orm import Session
2526

2627
from app import crud, log_utils, models, schemas
2728
from app.api import DEFAULT_404_MESSAGE
2829
from app.crud.crud_test_run_execution import ImportError
2930
from app.db.session import get_db
31+
from app.default_environment_config import default_environment_config
3032
from app.models.test_run_execution import TestRunExecution
3133
from app.schemas.test_run_execution import TestRunExecutionUpdate
3234
from app.test_engine import TEST_ENGINE_ABORTING_TESTING_MESSAGE
@@ -41,6 +43,8 @@
4143

4244
router = APIRouter()
4345

46+
DEFAULT_CLI_PROJECT_NAME = "CLI Project Execution"
47+
4448

4549
@router.get("/", response_model=List[schemas.TestRunExecutionWithStats])
4650
def read_test_run_executions(
@@ -93,6 +97,44 @@ def create_test_run_execution(
9397
return test_run_execution
9498

9599

100+
@router.post("/cli", response_model=schemas.TestRunExecutionWithChildren)
101+
def create_cli_test_run_execution(
102+
*,
103+
db: Session = Depends(get_db),
104+
test_run_execution_in: schemas.TestRunExecutionCreate,
105+
selected_tests: schemas.TestSelection,
106+
config: dict = {},
107+
) -> TestRunExecution:
108+
"""Creates a new test run execution on CLI request."""
109+
if not config:
110+
config = default_environment_config.__dict__
111+
112+
logger.info(f"CLI Config Arguments: {config}")
113+
114+
# Retrieve the default CLI project
115+
cli_project = crud.project.get_by_name(db=db, name=DEFAULT_CLI_PROJECT_NAME)
116+
117+
# If the default CLI project does not exist, create it
118+
if not cli_project:
119+
project = schemas.ProjectCreate(name=DEFAULT_CLI_PROJECT_NAME)
120+
project.config = config
121+
project = crud.project.create(db=db, obj_in=project)
122+
else:
123+
# Update the default CLI project the cli config argument
124+
project = crud.project.update(
125+
db=db, db_obj=cli_project, obj_in=schemas.ProjectUpdate(config=config)
126+
)
127+
128+
# TODO: Remove test_run_config completely from the project
129+
test_run_execution_in.project_id = project.id
130+
test_run_execution_in.certification_mode = False
131+
132+
test_run_execution = crud.test_run_execution.create(
133+
db=db, obj_in=test_run_execution_in, selected_tests=selected_tests
134+
)
135+
return test_run_execution
136+
137+
96138
@router.put("/{id}/rename", response_model=schemas.TestRunExecutionWithChildren)
97139
def rename_test_run_execution(
98140
*, db: Session = Depends(get_db), id: int, new_execution_name: str

app/crud/crud_project.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class CRUDProject(
3131
CRUDBaseDelete[Project],
3232
CRUDBaseUpdate[Project, ProjectUpdate],
3333
):
34+
def get_by_name(self, db: Session, name: str) -> Optional[Project]:
35+
return db.query(self.model).filter(self.model.name == name).first()
36+
3437
def get_multi(
3538
self,
3639
db: Session,

0 commit comments

Comments
 (0)