Closed devvmh closed 2 years ago
Did a quick check on this during lunch and found two issues,
@forslund Thanks a lot for your comment! With that guidance I was able to find the issues in my local code.
I have a local commit that fixes it - is there a certain branch I should cut a PR against?
here's the diff in case I lose track of it
onses.pyit a/test/integrationtests/voight_kampff/features/steps/utterance_responses.py b/test/integrationtests/voight_kampff/features/steps/utterance_res
index e7422712b2..c0991882f1 100644
--- a/test/integrationtests/voight_kampff/features/steps/utterance_responses.py
+++ b/test/integrationtests/voight_kampff/features/steps/utterance_responses.py
@@ -75,9 +75,12 @@ def dialog_from_sentence(sentence, skill_path, lang):
Returns (str): Dialog file best matching the sentence.
"""
- dialog_paths = join(skill_path, 'dialog', lang, '*.dialog')
+ dialog_paths = [
+ *glob(join(skill_path, 'dialog', lang, '*.dialog')),
+ *glob(join(skill_path, 'locale', lang, '**', '*.dialog'))
+ ]
best = (None, 0)
- for path in glob(dialog_paths):
+ for path in dialog_paths:
patterns = load_dialog_file(path)
match, _ = _match_dialog_patterns(patterns, sentence.lower())
if match is not False:
@@ -98,7 +101,7 @@ def _match_dialog_patterns(dialogs, sentence):
dialogs = [re.sub(r'{.*?\}', r'.*', dia) for dia in dialogs]
# Remove left over '}'
dialogs = [re.sub(r'\}', r'', dia) for dia in dialogs]
- dialogs = [re.sub(r' .* ', r' .*', dia) for dia in dialogs]
+ dialogs = [re.sub(r' [^\)]* ', r' .*', dia) for dia in dialogs]
# Merge consequtive .*'s into a single .*
dialogs = [re.sub(r'\.\*( \.\*)+', r'.*', dia) for dia in dialogs]
# Remove double whitespaces
nevermind! I see https://github.com/MycroftAI/mycroft-core/pull/3068 now :D much nicer code
Describe the bug I'm writing a VK test for my new skill: https://github.com/devvmh/tv-remote-control-skill. When I use the
Then {skill} should reply with dialog from {file}
format, then everything works fine. However, when I try to use example dialog it fails and I don't know why.Documentation I'm following: https://mycroft-ai.gitbook.io/docs/skill-development/voight-kampff/test-steps#reply-with-example-phrase
To Reproduce
Expected behavior
Log files
Here's the output of
mycroft-start vktest -t tv-remote-control-skill
: https://pastebin.com/VDaNWBrFrelevant lines from audio.log: https://pastebin.com/htimyqnj relevant lines from skills.log: https://pastebin.com/vvTQwVFY
(nothing was output during the time of test to the other files)
Environment (please complete the following information):
git log
suggests I'm at 21.2 (commit 8051e4e1f89d5ed1f63f06db5d3570371ae92e5d)