Apply language settings from _common.yaml in slot combination tests - #4027
Merged
bluefoxlee merged 2 commits intoJul 30, 2026
Merged
Conversation
The lang_resources fixture builds its intents dict by hand and reads only skip_words from _common.yaml, so settings is dropped. Eight languages are therefore tested under a configuration Home Assistant never uses: zh-CN/zh-HK/zh-TW declare ignore_whitespace, and cs/de/ne/nl/vi declare filter_with_regex, but both fall back to the hassil defaults. common_dict is already loaded on the preceding line.
parkghost
force-pushed
the
fix/apply-language-settings-in-tests
branch
from
July 29, 2026 21:44
b439dcb to
7985923
Compare
parkghost
marked this pull request as draft
July 29, 2026 21:44
Contributor
Author
|
Once #4026 is merged this PR turns green as-is — it is based on Feel free to do both yourself if you get there first, or ping me and I will. |
parkghost
marked this pull request as ready for review
July 30, 2026 02:03
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.
Important
CI fails here by design, and the failure is the point. With
settingsapplied, the two Englishsearch_queryexamples currently onmainare exposed as asserting a value that never occurs in Home Assistant:Those two examples are corrected in #4026. Once that lands, this PR goes green with no changes needed here. Marked as draft until then.
Changes
lang_resources(tests/test_slot_combinations.py:132) builds its intents dict by hand and reads onlyskip_wordsfrom_common.yaml, sosettingsis dropped. As a result 8 languages are tested under a configuration Home Assistant never uses:_common.yamlzh-CNzh-HKzh-TWignore_whitespace: truefalse(hassil default)csdenenlvifilter_with_regex: falsetrue(hassil default)The same sentence can therefore resolve to different slot values here and in the packaged data.
在電視上播放 Taylor Swiftgivessearch_query='Taylor Swift'in this repo's tests but'TaylorSwift'in theintents-packagesanity check, which loads the exported JSON wheresettingsis present. That divergence is what #4026 had to work around.common_dictis already loaded on the preceding line, so the fix is to readsettingsfrom it as well:Worth noting why this stayed invisible: dropping
settingsonly ever makes tests more permissive, never red. No existing test sentence can tell the two configurations apart — flippingignore_whitespacetofalsefor all three Chinese languages leaves them at 712 passed. The behaviour it protects (input containing spaces, e.g.打開 大燈) has no test coverage at all.The underlying wildcard behaviour that this exposes is reported upstream in OHF-Voice/hassil#276.
Testing
Verified on top of #4026:
python3 -m script.intentfest validate(all languages) — All good!pytest tests -n auto— 14662 passedNo language changes behaviour under the corrected configuration.