DevOps Your Skill: Validation Tests
DevOps Your Skill: Validation Tests
In this article, we discuss how to make validation tests and run it in Alexa in your pipeline and its importance in the day-to-day Alexa Skills development.
Join the DZone community and get the full member experience.Join For Free
There is another important step in an Alexa Skill development process. It is not related to the code or if the skill and its components are running properly. This step is the validation of our Alexa Skill before submitting it to certification. It means that the metadata of our Skill (logos, description, examples, etc) are properly filled. We can check it in our pipeline thanks to the ASK CLI and the use of the Alexa Skill Management API.
One of the most important steps in our pipeline is to validate our Alexa Skill. These tests are automated in the continuous integration system (CircleCI) and are executed in each new version of the software.
Here you have the technologies used in this project
- ASK CLI - Install and configure ASK CLI.
- CircleCI Account - Sign up here.
- Node.js v10.x.
- Visual Studio Code.
The Alexa Skills Kit Command Line Interface (ASK CLI) is a tool for you to manage your Alexa skills and related resources, such as AWS Lambda functions. With ASK CLI, you have access to the Skill Management API, which allows you to manage Alexa skills programmatically from the command line. We will use this powerful tool to validate our Alexa Skill. Let's start!
The ASK CLI is included in the Docker image we are using, so it is not necessary to install anything else.
In this step of the pipeline, we are going to develop some tests written in bash using the ASK CLI.
The Alexa Official documentation says that the Alexa Skill Validation API is an asynchronous API that can be used by skill developers to validate their skills before submitting them for certification or at any time during development as regression testing. A successful response may contain both successful and failed validation results. The Alexa Skill Validation API will also determine if a skill update qualifies for an instant update to a live skill.
This is an asynchronous process. so we have to start the validation with one command and then get the result with another when the validation is finished:
- For ask cli v1:
- For ask cli v2:
Those commands are integrated into the bash script file
Here you can find the full bash script:
The test automatically detects if the Alexa Skill is ready to submit to certification.
This script has two parameters:
- The id of the skill
- The version of the ASK CLI you are running (v1 or v2).
There are not reports defined in this job.
It is not necessary to integrate it in
Everything is ready to run and validate our Alexa Skill, so let's add it to our pipeline!
This job will execute the following tasks:
- Restore the code that we have downloaded in the previous step in
- Run the
- Persist again the code that we will reuse in the next job
Note: To perform these tests in CircleCI, you have to set the environment variable
SKILL_ID with the id of your Alexa Skill.
- DevOps Wikipedia - Wikipedia reference
- Official Alexa Skill Management API Documentation - Alexa Skill Management API Documentation
- Official CircleCI Documentation - Official CircleCI Documentation
We have to keep in mind this kind of test. Despite we are not checking code here, this test will validate that our Alexa Skill will look really cool in the Skill Store so do not forget to run it. This is why these tests are very relevant in our pipeline. Thanks to the ASK CLI we can perform these complex tests.
That’s all, folks!
You can find the code in my GitHub.
I hope it will be useful! If you have any doubts or questions, do not hesitate to contact me or put a comment below.
Opinions expressed by DZone contributors are their own.