Skip to content

[zh-TW] Use Chinese search_query examples in HassMediaSearchAndPlay tests - #4026

Merged
bluefoxlee merged 2 commits into
OHF-Voice:mainfrom
parkghost:fix/zh-tw-chinese-search-query-examples
Jul 30, 2026
Merged

[zh-TW] Use Chinese search_query examples in HassMediaSearchAndPlay tests#4026
bluefoxlee merged 2 commits into
OHF-Voice:mainfrom
parkghost:fix/zh-tw-chinese-search-query-examples

Conversation

@parkghost

@parkghost parkghost commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Changes

The two English search_query examples added in #4025 pass this repo's CI but fail the packaging sanity check in OHF-Voice/intents-package, which will break the nightly build

The cause is a configuration difference, not the templates. zh-TW sets ignore_whitespace: true, which strips whitespace from the whole utterance before matching. 在電視上播放 Taylor Swift therefore resolves to search_query='TaylorSwift' when language settings are applied — as they are in the packaged JSON that Home Assistant loads — but to 'Taylor Swift' when they are not, which is the case in this repo's test fixture.

This PR replaces both English examples with Chinese ones that resolve to the same value under either configuration, so the sanity check passes regardless:

sentence ignore_whitespace: false true
在電視上播放 五月天 '五月天' '五月天'
在客廳播放 怪物 的專輯 '怪物' '怪物'

Spaces around a query are dropped either way, because the wildcard strips leading and trailing whitespace from its capture.

The fixture issue behind the divergence is fixed separately in #4027. The underlying wildcard behaviour is reported upstream in OHF-Voice/hassil#276.

Testing

  • python3 -m script.intentfest validate (all languages) — All good!
  • pytest tests -n auto — 14662 passed
  • Same suite re-run with settings applied (i.e. the packaged configuration) — 14662 passed

The second run is the one that matters here: it confirms these examples hold under the configuration the sanity check uses.

…ests

The two English examples added in OHF-Voice#4025 pass this repo's CI but fail the
packaging sanity check in OHF-Voice/intents-package, because zh-TW sets
ignore_whitespace and the packaged data applies it while this repo's test
fixture does not.

Replaces them with Chinese examples that resolve to the same value under
either configuration.
@bluefoxlee
bluefoxlee merged commit 64d1069 into OHF-Voice:main Jul 30, 2026
2 checks passed
@parkghost
parkghost deleted the fix/zh-tw-chinese-search-query-examples branch July 30, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants