Commit Graph

2519 Commits (fa4173a2d3672c9609dde82e55571734d864fd03)

Author SHA1 Message Date
Matthew D. Scholefield 8c0b471d24 Fail wake word upload on first try
Previously failed wake words would collect and each one would attempt an upload and fail. Now, this does the same process but failing on the first wake word that fails to upload
2018-05-15 12:31:06 -05:00
Matthew D. Scholefield 3fa958cbac Make scp upload quiet and reduce saved seconds
The scp upload shows the account id which isn't the best to put in logs
The saved audio seconds used to contain audio before so that it could be used to identify multiple recordings that didn't activate the device. However, we've since moved to tagging only the last 3 seconds
2018-05-15 12:28:28 -05:00
Åke d18aed4f23
Merge pull request #1593 from MycroftAI/feature/update-msm
Update msm
2018-05-15 18:02:20 +02:00
Matthew D. Scholefield fff89a46ba
Update msm
Brings in new change that fixes skills not updating eventually
2018-05-15 10:38:29 -05:00
Matthew D. Scholefield afe8641159 Stability improvements 2018-05-14 16:41:19 -05:00
Matthew D. Scholefield 4e077b86e3 Upgrade msm 2018-05-14 16:41:06 -05:00
Åke ad487cc9fc
Merge pull request #1586 from MycroftAI/feature/configurable-update-interval
Make skill update interval configurable
2018-05-14 22:39:26 +02:00
Matthew D. Scholefield d6f5dd95c5 Make skill update interval configurable 2018-05-14 15:21:36 -05:00
Matthew D. Scholefield 7ef551ddc6 Fix error with skills test descriptor 2018-05-14 14:27:37 -05:00
Matthew D. Scholefield 32b14d0a0b Add skillstest to start-mycroft 2018-05-14 14:27:37 -05:00
Matthew D. Scholefield 0850f5073a Fix tests for Python 3
- Change print statements
 - Change queue import
2018-05-14 14:27:37 -05:00
Matthew D. Scholefield e3b87be48e Rename unit tests to test_name.py to be consistent
This also fixes pytest not picking up some tests
2018-05-14 14:27:37 -05:00
Åke Forslund 40fd0487d0 Clean up output slightly
The converse request / response messages are now hidden.
2018-05-14 14:27:37 -05:00
Åke Forslund 83a6be7fcb Override get_response to handle conversations
Adds the possibility to add a responses list in the test case. The test
will respond with each of the entries in the list to get_response
requests.

Ex:
{
  [...]
  "responses": ["yes", "Miami"]
}
2018-05-14 14:27:37 -05:00
Åke Forslund ce410c2f0c Fix expected_data
expected_data would fail in combination with Intent tests, this
differentiates it from the other rules
Add message type as "__type__" in the data for processing using
expected_data.
2018-05-14 14:27:37 -05:00
Åke Forslund c8b58f3f37 Inject message type as __type__ in the test data 2018-05-14 14:27:37 -05:00
Åke Forslund dc58402f39 Fix message_tester.py
Make skill optional and disable expected_dialog if missing.
2018-05-14 14:27:37 -05:00
Matthew D. Scholefield bd51eecd6a Switch test framework to pytest
Also sources the virtualenv before running tests
2018-05-14 14:27:37 -05:00
Åke Forslund e6017ec496 Fix issues detected by codacy 2018-05-14 14:27:37 -05:00
Åke Forslund 4a7cf45ada Add possibility to add a custom test runner
The custom test runner can be used for mocking third-party applications
or services.

To use create a __init__.py in the SKILL_DIR/test

The base of the file should look something like:

```python
from test.integrationtests.skills.skill_tester import SkillTest

def skill_runner(skill, example, emitter, loader, m1, m2):
    return SkillTest(skill, example, emitter).run(loader)
```

Then the skill_runner can be decorated by `mock.patch` to mock out resources.
2018-05-14 14:27:37 -05:00
Åke Forslund cab556450e Add expected_data option
Allows the intent test to check expected data content.

Example:

{
  "utterance": "set a weekend alarm at  9 am",
  "expected_data": {
      "ampm": "am",
      "time": "9",
      "daytype": "weekend"
  },
  "expected_response": "Okay. Setting a .* alarm"
}
2018-05-14 14:27:37 -05:00
Åke Forslund 9c4ac178b9 Give better feedback when skill isn't loaded
If a skill required for a test case isn't loaded an exception will be
raised.
2018-05-14 14:27:37 -05:00
Åke Forslund 3917726bb5 Use queue to get skill completion
This allows the skill test to exit directly after skill handler
completes.
2018-05-14 14:27:37 -05:00
Matthew D. Scholefield 65ad7d3bd6 Add pytest cache to .gitignore 2018-05-14 14:27:37 -05:00
Åke Forslund e7ead7ca6e Reduce timeout when skill has been handled 2018-05-14 14:27:37 -05:00
Matthew D. Scholefield 79bf94e48e Speed up intent tests by responding to converse requests 2018-05-14 14:27:37 -05:00
Åke Forslund 02565efd59 Use pytest to discover test cases 2018-05-14 14:27:37 -05:00
Matthew D. Scholefield 154ccd59d7 Expose single threaded training option from Padatious Service
This is necessary to prevent a deadlock when training during intent tests using pytest
2018-05-14 14:27:37 -05:00
Åke Forslund 921bc5f23d Add support for "expected dialog"
Loads dialogs and checks if any skills responds with one of the possible
dialogs.
2018-05-14 14:27:37 -05:00
Åke Forslund d10ba29f70 Fix pep8 issues 2018-05-14 14:27:37 -05:00
Åke Forslund 3fcb40c2bb Add new rule 'exists'
Rule is satisfied if the entry exists in the data field not taking into
account it's value at all:

Example:
{
    "utterance": "set an alarm on july 4th 2016 at 3pm",
    "evaluation_timeout": 10,
    "assert": "[['and', ['exists', 'ampm'], ['exists', 'time'] ]]"
}
2018-05-14 14:27:37 -05:00
Åke Forslund 90e719c29e Add padatious and fallbacks 2018-05-14 14:27:37 -05:00
Åke Forslund 3a9242c1c7 Allow utterance without intent_type and intents 2018-05-14 14:27:37 -05:00
Åke Forslund a206807606 Add simple script for running a single skill
Based on the skill_developers_testrunner.py, takes the path to a skill
as argument and runs any tests for that skill.
2018-05-14 14:27:37 -05:00
CarstenAgerskov 8ab30500d7 Cleaner and better format for examples in message_tester 2018-05-14 14:27:37 -05:00
CarstenAgerskov 1cbedaea3c Added test_all_skills. More doc. 2018-05-14 14:27:37 -05:00
CarstenAgerskov 6c226ea4d9 Added message tester utility. Reduced line length to <80 chars in general 2018-05-14 14:27:37 -05:00
CarstenAgerskov a16c2a0ecc Added support for context, mycroft response and more. 2018-05-14 14:27:37 -05:00
CarstenAgerskov 7e9a05f4e0 First cut at skill tester
Minimum viable solution for running existing testcases (json files).
Currently considered additions:
(16, 3) # TODO: Make template for testing one skill only, for the skill
developer to use
(138, 11) # TODO: Pass something to intent, that tells that this is a
test run. The skill intent can then avoid side effects
(144, 11) # TODO: add optional timeout parameter to test_case
(155, 11) # TODO: Check that all intents are checked (what about
context)
(169, 3) # TODO: Add command line utility to test an event against a
test_case, allow for debugging tests
(173, 11) # TODO: Add support for expected response, and others
2018-05-14 14:27:37 -05:00
Matthew D. Scholefield 397435afcb Update msm version (#1589) 2018-05-14 20:15:51 +02:00
Åke d63a747b9f
Enforce integer for positions in mouth display (#1588)
In python 3 these would default to floats, which trips up the arduino
2018-05-14 11:48:27 +02:00
Åke Forslund 51c21d87ad Fix not upgraded python packages 2018-05-11 16:31:04 -05:00
Åke 668323510e
Merge pull request #1585 from MycroftAI/bugfix/skill-reload
Fix skill reloading when files in subdirectories change
2018-05-11 20:01:01 +02:00
Matthew D. Scholefield d1358cc0fc Fix skill reloading when files in subdirectories change 2018-05-11 12:04:30 -05:00
Åke Forslund 0087803d5d Fix trying to make integer from skill-id
skill id's are now the skill path, and can't be made into integers. This issue hinders padatious skills from running.
2018-05-11 10:30:06 -05:00
Åke e8682d8fc5
Merge pull request #1581 from forslund/feature/enclosure-1.4.0
Bump enclosure version to 1.4.0
2018-05-11 14:28:09 +02:00
Åke Forslund 79d183d59f Bump enclosure version to 1.4.0 2018-05-11 14:26:06 +02:00
Michael Nguyen e54b46b06f
Merge pull request #1580 from MycroftAI/bugfix/consistent-skill-ids
Make skill ids use skill folder
2018-05-11 01:29:48 -05:00
Matthew D. Scholefield fc8424c9ee Make skill ids use skill folder
This is necessary because in Python 3, hash(x) changes every single start of the application. Using the skill folder makes it consistent. In addition, the skill folder makes it easier to debug parts of the application in comparison to using something like an md5sum
2018-05-10 18:52:17 -05:00
Michael Nguyen 67b610373d
Merge pull request #1578 from MycroftAI/feature/msm-upgrade
Upgrade msm
2018-05-10 17:51:01 -04:00