-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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 MQTT tests to use modern platform schema part 1 #77387
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
probot-home-assistant
bot
added
code-quality
core
has-tests
integration: mqtt
small-pr
PRs with less than 30 lines.
labels
Aug 26, 2022
Hey there @emontnemery, mind taking a look at this pull request as it has been labeled with an integration ( |
jbouwh
changed the title
Refactor MQTT tests to use modern platform schema
Refactor MQTT tests to use modern platform schema part 1
Aug 29, 2022
23 tasks
jbouwh
force-pushed
the
mqtt-tests-modern-yaml
branch
from
August 30, 2022 19:53
bad1c3b
to
c092ab7
Compare
23 tasks
emontnemery
reviewed
Aug 31, 2022
jbouwh
force-pushed
the
mqtt-tests-modern-yaml
branch
from
September 3, 2022 07:44
b8afe89
to
b1eb85f
Compare
emontnemery
approved these changes
Sep 6, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
The tests for the MQTT schema rely mainly on yaml the deprecated platform schema. When this is going to be removed with HA 2022.12.0 we need to update the tests to use the modern schema.
This PR will be the start of adopting the the modern schema.
For al platform tests a new
DEFAULT_CONFIG
will be defined, a clone without theplatform
attribute.DEFAULT_CONFIG_LEGACY
will hold the default config for the deprecated schema.A new test will be added temporary to still test setup with the deprecated schema:
test_setup_with_legacy_schema
.So all (common)tests that are not converted yet to the new schema will use
DEFAULT_CONFIG_LEGACY
config until the common code is migrated.I'll use one commit per platform to begin with. Common tests will be updated later. Finally when the support for config under the platform key is removed all tests referring to the old schema will be labeled with deprecation comment.
Part 1 covers the specific platform tests (see changed files) and tests from
test_init.py
.Part 2 will cover the other platforms: #77525
A PR for the common tests can be found here: #77583
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
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:
To help with the load of incoming pull requests: