Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Voight kampff config given #2576

Merged
merged 4 commits into from
May 19, 2020

Conversation

forslund
Copy link
Collaborator

@forslund forslund commented May 8, 2020

Description

Adds the Given the user's {config} is {value} step implementation

This will patch the configuration with a section from a dictionary that
can either be a global (shipped in
mycroft/res/{lang}/configurations.json) or shipped with the test
definition. The file should be named the same as the feature file but
instead of .feature the extension should be .config.json.

mycroft/res/text/en-us/configurations.json contains a couple of
pre-defined configurations that can be applied

  • units (metric/imperial)
  • location (Stockholm)

After each scenario any applied patch will be cleared

In addition this PR adds the message configuration.patch.clear to clear an applied patch.

If this is approach is good enough it resolves #2547.

How to test

Contributor license agreement signed?

CLA [ Yes ]

@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label May 8, 2020
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@MycroftAI MycroftAI deleted a comment from devops-mycroft May 8, 2020
@forslund forslund force-pushed the feature/voight-kampff-config branch from 14a632e to 9a81e32 Compare May 18, 2020 12:30
Adds the "Given the user's {config} is {value}" step implementation

This will patch the configuration with a section from a dictionary that
can either be a global (shipped in
mycroft/res/{lang}/configurations.json) or shipped with the test
definition. The file should be named the same as the feature file but
instead of ".feature" the extension should be ".config.json".

mycroft/res/text/en-us/configurations.json contains a couple of
pre-defined configurations that can be applied
- units (metric/imperial)
- location (Stockholm)

After each scenario any applied patch will be cleared
- Copyright year
- typo
@forslund forslund force-pushed the feature/voight-kampff-config branch from 9a81e32 to e08f630 Compare May 18, 2020 12:48
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results)

@MycroftAI MycroftAI deleted a comment from devops-mycroft May 18, 2020
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@krisgesling krisgesling self-requested a review May 19, 2020 00:55
Copy link
Contributor

@krisgesling krisgesling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, love the cleanup of all the docstrings too.

@forslund forslund merged commit 06e958c into MycroftAI:dev May 19, 2020
@forslund forslund deleted the feature/voight-kampff-config branch May 19, 2020 06:29
@damorosodaragona
Copy link

damorosodaragona commented Oct 2, 2020

Please add this information on the mycroft guide in the test section.
Are 4 days that i'm tryng to understand how to use this step (given user's config is value).
Just yestarday reading the code i understood that the configuration file must live in a specific directory, but was not clear why and how use it.
Now reading this i got it. But i found this pull request by chance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Voight Kampff should allow setting unit
5 participants