test: add sync-validation tests for config strings and translations#1448
Open
florianhorner wants to merge 2 commits intobasnijholt:mainfrom
Open
test: add sync-validation tests for config strings and translations#1448florianhorner wants to merge 2 commits intobasnijholt:mainfrom
florianhorner wants to merge 2 commits intobasnijholt:mainfrom
Conversation
Adds 6 tests that prevent drift between strings.json, en.json, translation files, and services.yaml. Tests use only stdlib + yaml (no homeassistant dependency) so they run without the HA test env. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
for more information, see https://pre-commit.ci
4 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
tests/test_strings_sync.pywith 6 tests that prevent drift betweenstrings.json,en.json,services.yaml, and translation filesTests
test_strings_and_en_json_step_keys_match— step names match between strings.json and en.jsontest_translation_files_have_step_structure— all 38 translation files define the same step keystest_translation_files_have_error_keys— all translation files define the same error keystest_services_yaml_fields_have_descriptions— every service field has a descriptiontest_error_keys_cover_config_flow— error keys in strings.json cover what config_flow.py usestest_en_json_matches_strings_json_options— en.json and strings.json options are structurally identicalMotivation
Currently there's no automated check that UI strings, service descriptions, and translations stay in sync. These tests catch missing keys, structural drift, and undocumented fields before they ship.
Test plan
🤖 Generated with Claude Code