-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add VK test - specific skill should not reply #2618
Conversation
return False, debug | ||
context.bus.new_message_available.wait(0.5) | ||
# Timed out return debug from test | ||
return True, debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test_failed
variable doesn't sem to be used.
The answer to this is probably "No" but I'll ask anyway,
could this function be
def then_wait_fail(msg_type, criteria_func, context, timeout=TIMEOUT):
"""Wait for a specified time failing if criteria is fulfilled.
[...]
"""
res = then_wait(msg_type, criteria_func, context, timeout)
return (not res[0], res[1])
Voight Kampff Integration Test Succeeded (Results) |
Regarding using msm to lookup the skill as you suggest The context contains msm so a check could be done if skill = context.msm.local_skills.get(skill_name) or context.msm.find(skill_name)
if basename(skill.path) == skill_id_from_speak_message:
do_stuff() Or something similar perhaps? Edit: Just to clarify, I think this is a good first pass that could be merged as is and then built upon to allow more variants of skill name. |
d825875
to
b60c038
Compare
Hello @krisgesling! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-06-18 13:03:38 UTC |
b60c038
to
028adb1
Compare
Thanks Ake, negating the existing function does work. I went through a lot of variations trying to use the existing functions rather than adding another. By the time I resigned myself to adding a new function to tools.py I'd lost sight of the easy answer! Agree that we should add this, and I'll revisit the Skill searching and adding skill_id to the meta dict later. |
Voight Kampff Integration Test Succeeded (Results) |
1 similar comment
Voight Kampff Integration Test Succeeded (Results) |
028adb1
to
247c6d3
Compare
Voight Kampff Integration Test Failed (Results) |
Voight Kampff Integration Test Succeeded (Results) |
Description
Adds a test tool opposite to then_wait. Instead of the test succeeding when the criteria is met, the test fails if the given criteria is detected.
This is then used to test if a specific Skill responds to an utterance.
Improvements needed
It feels like there is a better way to do this, but it's working for me right now, so thought I'd put it out in the world for critique. Suggestions welcome.
Would also prefer to utilize MSM to search for the name of the skill in the test which would add more flexibility to what test authors enter. Currently it requires that you enter the class name of the Skill.
How to test
With the following feature file for the News Skill:
First two should pass, last two should fail.
Contributor license agreement signed?