Adding nfc-wifi to the backend rebased to V2.15-develop#294
Adding nfc-wifi to the backend rebased to V2.15-develop#294ArnoldBraine wants to merge 8 commits intoproject-chip:v2.15-developfrom
Conversation
Summary of ChangesHello @ArnoldBraine, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces comprehensive support for a new NFC-WIFI device pairing mode across the backend system. The changes involve updating core constants, modifying setup procedures to accommodate NFC-specific hardware interactions, and extending utility functions to handle WiFi network credentials for this new mode. Additionally, the YAML test runner has been enhanced with a dedicated method for NFC-WIFI pairing, accompanied by new test cases to ensure the functionality is correctly implemented and validated. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully adds support for the nfc-wifi pairing mode. The changes are consistent with the existing codebase, and it's great to see that new tests have been added to cover this new functionality. My review includes a few suggestions to improve code readability and reduce duplication. Specifically, I've recommended using the in operator for membership testing and pointed out opportunities to use pytest.mark.parametrize to consolidate similar test cases, which will enhance maintainability.
test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py
Outdated
Show resolved
Hide resolved
test_collections/matter/sdk_tests/support/python_testing/models/utils.py
Outdated
Show resolved
Hide resolved
| ] == arguments | ||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_generate_command_arguments_nfc_wifi() -> None: |
There was a problem hiding this comment.
This new test, test_generate_command_arguments_nfc_wifi, is nearly identical to the existing test_generate_command_arguments_ble_wifi. To avoid code duplication and improve maintainability, I recommend using pytest.mark.parametrize to combine these into a single parameterized test. This would make it easier to add and test other Wi-Fi based pairing modes in the future.
| chip_server._ChipServer__node_id = None | ||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_pairing_nfc_wifi_command_params() -> None: |
There was a problem hiding this comment.
The new test test_pairing_nfc_wifi_command_params is very similar to test_pairing_ble_wifi_command_params. To reduce code duplication and make the test suite more maintainable, consider using pytest.mark.parametrize to create a single, parameterized test function that can handle various Wi-Fi pairing modes.
test_collections/matter/sdk_tests/support/yaml_tests/models/chip_suite.py
Outdated
Show resolved
Hide resolved
| discriminator=self.config_matter.dut_config.discriminator, | ||
| ) | ||
|
|
||
| async def __pair_with_dut_nfc_wifi(self) -> bool: |
There was a problem hiding this comment.
The new method __pair_with_dut_nfc_wifi is almost identical to __pair_with_dut_ble_wifi and __pair_with_dut_wifipaf_wifi. This introduces significant code duplication. To improve maintainability, consider refactoring these into a single private helper method that accepts the specific pairing function (e.g., self.runner.pairing_nfc_wifi) as an argument. This would centralize the logic for Wi-Fi pairing.
test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py
Outdated
Show resolved
Hide resolved
I have updated the code according to the review, and with User Guide you are referring to the certfication-tool documentation right? |
Exactly @ArnoldBraine |
|
Hi @ArnoldBraine It seems there are some comments from gemini-code-assist still not addressed, also a rebase is required. Could you please take a look? |
Hi @rquidute,
|
Hi @ArnoldBraine |
Summary
Adding support for nfc-wifi rebased to V2.15-develop using the reference pull requests from @OlivierGre
Add nfc-thread pairing mode #185
Change to be able to use NFC Commissioning in YAML test. #201
Disable Polkit in chip-cert-bins #269