CarstenAgerskov / Mycroft-intent-test-runner

Apache License 2.0
1 stars 0 forks source link

Not getting how to give arguments #1

Open patilaum opened 6 years ago

patilaum commented 6 years ago

Using Ubuntu 16.04 I want to intent of my test my skill https://github.com/patilaum/mycroft-person-detect-skill.git I ran python intent_test_runner.py [{skill_path | --/opt/mycroft/skills/mycroft-person-detect-skill.patilaum [--config /home/aum/mycroft-core/mycroft/configuration/mycroft.conf]`

It gave some long list of errors like BrokenPipeError and many others here is a sample of that long list

FileNotFoundError: [Errno 2] No such file or directory: '[{skill_path/test/intent/' During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "intent_test_runner.py", line 205, in main() File "intent_test_runner.py", line 201, in main if not container.run_test_suite(): File "intent_test_runner.py", line 89, in run_test_suite self.stop() AttributeError: 'SkillTestContainer' object has no attribute 'stop' Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='UTF-8'> BrokenPipeError: [Errno 32] Broken pipe

Its giving following error when I ran command python3 intent_test_runner.py --all-skills --config /home/aum/mycroft-core/mycroft/configuration/mycroft.conf

11:38:13.401 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/aum/mycroft-core/mycroft/configuration/mycroft.conf loaded Running test for: /opt/mycroft/skills/mycroft-joke.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-playback-control.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-naptime.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-npr-news.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-reminder.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-ip.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-singing.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-installer.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-pairing.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-person-detect-skill.patilaum/ Running test for: /opt/mycroft/skills/mycroft-hello-world.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-audio-record.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-date-time.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-weather.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-alarm.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-volume.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-spelling.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-support-helper.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-wiki.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-personal.mycroftai/ Running test for: /opt/mycroft/skills/fallback-wolfram-alpha.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-configuration.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-speak.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-stop.mycroftai/ Running test for: /opt/mycroft/skills/mycroft-stock.mycroftai/

I'm not sure whether my skill was tested or not.

please help me troubleshoot this and give one example of usage command.

CarstenAgerskov commented 6 years ago

Hi

The testrunner is now a part of Mycroft-core, this repo is outdated and not maintained. Sorry, I should delete it.

In mycroft-core/test/integrationtests/skills you will find the newest files. Remember to source .venv/bin/activate in mycroft-core before running the tests.

The testrunner is described here: https://github.com/MycroftAI/docs-rewrite/blob/master/_pages/automatic-testing.md

Regards Carsten

CarstenAgerskov commented 6 years ago

By the way, is your issue with testing, or are you just trying to run the skill now?

patilaum commented 6 years ago

I installed my skill through mycroft home login. When I started mycroft and gave commands "how many men are there in front of you" (which is my intent itself), the mycroft didn't gave required output or rather it gave output of other skills or said "I didn't catch that". So I thought it would be wise to test the intents. Please help me if you can

CarstenAgerskov commented 6 years ago

If you open the CLI (./start-mycroft.sh cli) and then update your skill (touch __init__.py) in your skill, the CLI will show the load process, and any errors.

Maybe the long keywords (sentence) could be a problem, I am not sure. I usually use keywords on one or two words, and the a regex in the intent method declaration, instead of a keyword.

But if you don't need contexts, or parameters, the Padatious parser might be a better/easier choice: https://mycroft.ai/documentation/padatious/

Also, check out https://chat.mycroft.ai/ to get help :)

CarstenAgerskov commented 6 years ago

You can also try ./start-mycroft.sh skill_container /opt/mycroft/skills/<your skill>

patilaum commented 6 years ago

I dont know why but both ./start-mycroft.sh skill_container /opt/mycroft/skills/ and ./start-mycroft.sh cli are showing same errors i.e. ConnenctionRefusedError. Also I update my skill with short keywords.(not in repo but in my opt/skill/ folder). I also tested intent and following is the output

12:32:03.825 - mycroft.skills.core:load_skill:105 - INFO - ATTEMPTING TO LOAD SKILL: mycroft-person-detect-skill.patilaum with ID test-mycroft-person-detect-skill.patilaum 12:32:03.827 - mycroft.skills.core:load_skill:144 - ERROR - Failed to load skill: mycroft-person-detect-skill.patilaum Traceback (most recent call last): File "/home/aum/mycroft-core/mycroft/skills/core.py", line 115, in load_skill ('.py', 'rb', imp.PY_SOURCE) File "/usr/lib/python3.5/imp.py", line 234, in load_module return load_source(name, filename, file) File "/usr/lib/python3.5/imp.py", line 172, in load_source module = _load(spec) File "", line 693, in _load File "", line 673, in _load_unlocked File "", line 665, in exec_module File "", line 222, in _call_with_frames_removed File "/opt/mycroft/skills/mycroft-person-detect-skill.patilaum/init.py", line 24, in import numpy as np ImportError: No module named 'numpy' 12:32:03.829 - mycroft.skills.padatious_service:train:70 - INFO - Training... 12:32:03.831 - mycroft.skills.padatious_service:train:72 - INFO - Training complete. E

ERROR: test_IntentValidation[mycroft-person-detect-skill.patilaum:sample1] (main.IntentTestSequence)

Traceback (most recent call last): File "skill_developers_testrunner.py", line 64, in test if not SkillTest(a, b, self.emitter).run(self.loader): File "/home/aum/mycroft-core/test/integrationtests/skills/skill_tester.py", line 198, in run raise Exception('Skill couldn\'t be loaded') Exception: Skill couldn't be loaded


Ran 1 test in 8.350s

FAILED (errors=1)

I don't understand why it is not able to import numpy.

CarstenAgerskov commented 6 years ago

You need to install numpy. In the mycroft virtual env. In your requirements.txt file, you must add numpy, that will install the dependancy in the mycroft env (also for other users getting your skill in the future:)

If you just want to move on without a "real" install, just: In your mycroft-core directory:

source .venv/bin/activate
pip install numpy

(I didn't try the commands above, but it should be close)