-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor homekit_controller config flow tests #32141
Refactor homekit_controller config flow tests #32141
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #32141 +/- ##
==========================================
- Coverage 94.73% 94.72% -0.01%
==========================================
Files 767 767
Lines 55509 55500 -9
==========================================
- Hits 52584 52575 -9
Misses 2925 2925
Continue to review full report at Codecov.
|
We can announce that the old json files are deprecated and then remove support after eg two releases. |
Thanks for the great feedback @MartinHjelmare! I think i've addressed all your points now. How do I go about announcing a deprecation? |
Make a PR and add a warning log message. Mark that PR breaking change and describe the deprecation in the breaking change paragraph. |
Will leave the remaining tests that are affected by #32158 alone until the deprecation period is over, then remove them. So I think thats everything in here? |
Proposed change
This refactors the homekit_controller config flow tests as per suggestion from @MartinHjelmare to use the
hass.config_entries.flow
methods to drive the tests, rather than calling the config flow directly.This has deleted and cleaned up a lot of duplicated mocks and stubs so makes the tests much more compact and easy to understand but retains the coverage.
Had to bump aiohomekit to pick up a fix from the testing helpers there, but its a no-op for the integration itself (test helper only release).
There are 3 tests I didn't migrate:
These are all to do with both pre-config-flow pairing json files (
.homekit/pairings.json
and.homekit/hk-00:00:00:00:00:00
). My preference would be to drop support for those files entirely. We haven't written to.homekit/pairings.json
since May 2019 and haven't written to the older format since December 2018. Every release since then will have created a config flow entry and then started to ignore the old files.If i have to keep them then i'll migrate them to the new style seperately - i need to do more refactoring on them that doesn't belong with this set of changes.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: