CI Testing a Skill

Hello,

I wrote a small skill and I’d like to add CI for it. I can’t seem to find any current examples of a Skill that has CI setup. Does anyone know of one that I could crib off of?

Thanks,
Ted

Hi @ted, great question!
With huge thanks to Community Developer @CarstenA and my colleague @forslund, we’re about to release documentation on our Integration Test Runner.
You can get a sneak peek with examples at;
https://github.com/MycroftAI/docs-rewrite/pull/51

That’s interesting, and looks like something that could be used for CI tests. It does look like the mycroft core package isn’t being built for amd64 though. Are there plans to provide the core on other architectures? Most CI runners are amd64.

https://repo.mycroft.ai/repos/apt/debian/pool/main/m/mycroft-core/

Not at this stage by the Mycroft team, but if the community are interested in building mycroft-core for other architectures we can provide guidance and assistance.

Oh, okay. I don’t see any packaging in the mycroft-core repository or scripts that are used to build packages. Are those available somewhere? Are the distributed packages built manually?

@forslund do we have any advice for Ted on packaging for other architectures?

So I went the route of just installing from Git since it seems that there aren’t packages built.

For those who are reading along, you can’t use the master branch of mycroft-core, you need to use a branch features/skill-tester on https://github.com/CarstenAgerskov/mycroft-core.git. That branch has the needed test scripts for the documentation linked above.

Now I’m at the point of not getting all the Python import paths quite right. If someone can see the error I’d love to know what is wrong here: https://gitlab.com/ted.gould/mycroft-skill-smarter-parents/-/jobs/61393220

The CI configuration I’m using is here: https://gitlab.com/ted.gould/mycroft-skill-smarter-parents/blob/master/.gitlab-ci.yml

1 Like

@forslund any thoughts here?

I can’t see what is wrong, unfortunately. However, my fork is somewhat old now. Maybe try to take the code from the dev branch on https://github.com/MycroftAI/mycroft-core. If that is working, then copy in the /test/integrationtests/skills directory afterwards. The newest version of the test runner is https://github.com/MycroftAI/mycroft-core/tree/feature/carstens-skill-tester/test/integrationtests.
Or clone from https://github.com/MycroftAI/mycroft-core/tree/feature/carstens-skill-tester

Thanks @CarstenA I switched to using that branch, it didn’t solve all my problems, but glad to know that I’m on the right track.

I figured out the virtualenv stuff. It was roughly getting everything put in the right place, and then executing the environment from that place. You can see the CI configuration here:

That CI config should work for any skill and run the Gitlab CI on it.

Now I’ve got my tests running, they’re failing, but that’s probably my fault. You can see a run here if you’re curious about how it works.

1 Like

That is a neat CI solution.

About the error, if you look at the Rule Status it starts out Rule status: [[‘and’, [‘endsWith’, ‘intent_type’, ‘QueryPVPMD’]…
If you look at your Evaluating message you see that ‘intent_type’: ‘1211234556:QueryPVPdm’. It fails since QueryPVPMD != QueryPVPdm

When it succeeds you should see rule status [[‘and’, [‘endsWith’, ‘intent_type’, ‘QueryPVPMD’],
succeeded]…

The message_tester.py is good for sorting out those details.

You may have to look at all “Evaluating message:” to get all parts of Rule Status to status succeeded.

One more thing, I see the parameter “Query: 'Who is smarter”. The W is capitalized. In your test case it is lower case. I guess this originate in Query.voc.

It might just be that the virtualenv isn’t started… try workon mycroft before running the python script.

Edit: Nevermind, I see you figured it out :slight_smile:

(Always late to the party)