New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Allow mycroft-speak and mycroft-say-to take bash pipes #2105
Comments
Ran into a snag creating a unittest. Mostly I don't know where the unit-tests for the bin/ scripts are. |
I do not think we have any unittests for the scripts yet. Since the tests are of the shell scripts would they be unittests or integration tests? Basically can they be run in isolation or is a mycroft instance required? |
I guess intergration would be more apt (from my understanding the scripts just send a preconfigured message onto the messagebus). |
Yeah, that's exactly how they work. I think adding a directory under the test/integrationtests folder for these would be the best place for them. |
So something like: To be honest I also have no idea how to write a test for a bash script that interfaces with python. Would I need to setup a mock messagebus to make sure that the messages are recieved correctly and that mycroft responds corretly? |
For an integration test it would interact with a running mycroft messagebus. I'm not certain myself what the best way to do this would be. Iguesds the test would connect to the messagebus, listen for the speak message. Then launch the script as a subprocess wait a short interval and check that the expected message was received. A bit complex to do. If you like to submit the change without a test that's ok.Iyt might be better investment of time if I wrote a unittestfor the underlying messagebus send function |
Currently this works with discrete messages from the echo command, but does not work with cat or streams of text. Scenarios I would like to work, but currently do not: xargs might be a work around for this, but still not as simply as just using a | |
For me this works: $ echo "hello there" > say.txt
$ cat say.txt
hello there
$ cat say.txt | ./bin/mycroft-speak |
That works for me too. My testfiles are: and the mycroft-say file which has a #, which also fails. |
Add the ability to | into mycroft-speak and mycroft-say-to to open up scripting options.
The text was updated successfully, but these errors were encountered: