Test tracks
Test track sandboxes by running simulated plays
Last updated
Was this helpful?
Test track sandboxes by running simulated plays
Last updated
Was this helpful?
This guide explains how to test a track to ensure your content is free from errors. You need the following to test tracks:
The instruqt track test
command simulates a user starting and completing a track. When you run this command, Instruqt starts a new instance of your track and simulates a learner going through the track by executing all challenge lifecycle scripts.
In the test, Instruqt deploys an instance of the track's sandbox (and runs the track setup scripts) and performs the following steps for each challenge:
Run the challenge setup script
Run check script, expecting failure.
Run solve script, to mimic what the user would do.
Run check script again, expecting success.
By running these steps, you achieve the following:
Mimic the learner's behavior.
Validate that the track starts properly.
Validate that the challenge life cycle scripts (setup
, check
and solve
) have been implemented correctly.
The test stops when one of the steps fails or when all steps have been completed successfully.
Tracks can only be tested using the Instruqt CLI.
In a track's directory, run the following command:
↳ Example output:
Add the --skip-fail-check
flag to the instruqt track test
command to skip the first check attempt and go straight to the solve script.
When the test has finished, it will automatically stop the track and delete the sandbox. If you would like to keep it running afterward, add the --keep-running
flag to the instruqt track test
command. This is useful when you debug a script issue and want to inspect the environment after the test has finished. If you are running the test with your credentials, you can go to and continue with the track where the test finished.
To run tests from a CI/CD system like GitHub actions, you must authenticate with an Instruqt API token. To do this, . Once you have your API token, create an environment variable named INSTRUQT_TOKEN
with the token value in your CI/CD system.
Many CI/CD systems support running commands on containers as part of the build/test process. Instruqt provides a Docker Container Image with the current version of the Instruqt CLI pre-installed. Use this in your CI/CD test pipelines to access the Instruqt CLI easily.