-
-
Notifications
You must be signed in to change notification settings - Fork 32.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 MQTT tests to use modern platform schema part 2 #77525
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
core
has-tests
integration: mqtt
small-pr
PRs with less than 30 lines.
labels
Aug 30, 2022
Hey there @emontnemery, mind taking a look at this pull request as it has been labeled with an integration ( |
jbouwh
force-pushed
the
mqttt-tests-modern-yaml2
branch
2 times, most recently
from
August 30, 2022 19:43
6391102
to
3872142
Compare
This was referenced Aug 31, 2022
jbouwh
force-pushed
the
mqttt-tests-modern-yaml2
branch
from
September 3, 2022 07:45
417bb15
to
cc0dcbf
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
When the legacy schema 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.
The tests for the MQTT integration rely mainly on yaml the deprecated platform 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.
This is a follow up for #77387
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: