Instruqt Docs
  • 🚩Getting started
    • Overview
    • Setting up
      • Study Room
    • Quickstart
  • 🛤️Tracks
    • Manage tracks
      • Create tracks
      • Edit locally
      • Test tracks
      • Track logs
      • Track time limits
      • Track feedback
      • Developer workflow
      • Track tags
      • Track authors
      • Delete tracks
      • Custom layouts
      • Version control
      • Loading experience
    • Challenges
      • Create challenges
      • Challenge tabs
      • Challenge order
      • Skip challenges
      • Add quizzes
      • Assignment display
      • Assignment editor
    • Share tracks
      • Live Events
        • Instructor tools
      • Track invites
      • Embed tracks
      • Landing pages
  • 🏖️Sandboxes
    • Overview
    • Sandbox hosts
      • Add hosts
      • Custom VM images
      • Custom container images
      • Public images
      • Windows VMs
      • Website service
      • SSL certificates
    • Cloud accounts
      • Securing your cloud accounts
      • Cloud Client
      • AWS accounts
        • AWS Environment Variables
        • AWS Managed Policies
        • AWS IAM Policies
        • AWS SCP Policies
      • Azure subscriptions
        • Azure Environment Variables
        • Azure Roles
        • Azure Resource Providers
      • GCP projects
        • GCP Environment Variables
        • GCP IAM Permissions
    • Lifecycle scripts
      • Scripting overview
      • Track scripts
      • Challenge scripts
      • Example scripts
      • Helper scripts
    • UI Checks
    • Global Sandbox Settings
      • Hot start
      • Sandbox presets
      • Custom resources
      • Cloud services and regions
        • Allowed services and regions
    • Secrets and variables
      • Runtime variables
      • Runtime parameters
      • Secrets
  • ⚙️Settings
    • Integrations
      • Salesforce (Beta)
      • HubSpot (Beta)
      • HubSpot (Using zapier)
      • LTI
      • Version control
        • GitHub
    • Authentication
      • SSO
      • API keys
    • Platform
      • API
      • Webhooks
      • Track limits
  • 💡Reference
    • Feature overview
    • Instruqt CLI
      • Commands
      • Configuration files
      • Assets
    • Instruqt platform
      • Networking
      • Host machine types
      • Quotas and limits
      • Roles and permissions
      • Network access
      • Requirements
  • 🛟Resources
    • Content design tips
    • Advanced use cases
    • Templates
    • FAQ
      • Running Windows Client Hosts on Instruqt
      • Using Cleanup Scripts in SaaS and Cloud Environments
      • Instruqt Regional Configurations and Restrictions
      • Troubleshooting Instruqt CLI Authentication Issues
      • Copy a Track from One Organization to Another via CLI
      • Network Configuration: IP and MAC Address Control
      • Container Troubleshooting in Instruqt
Powered by GitBook
On this page
  • Before you begin
  • Background
  • Test a track
  • Skip the checking steps
  • Keep tracks running after testing
  • Test in CI/CD pipelines
  • Set authentication
  • Docker Image

Was this helpful?

Edit on GitHub
  1. Tracks
  2. Manage tracks

Test tracks

Test track sandboxes by running simulated plays

PreviousEdit locallyNextTrack logs

Last updated 11 months ago

Was this helpful?

Before you begin

This guide explains how to test a track to ensure your content is free from errors. You need the following to test tracks:

Background

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:

  1. Run the challenge setup script

  2. Run check script, expecting failure.

  3. Run solve script, to mimic what the user would do.

  4. 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.

Test a track

Tracks can only be tested using the Instruqt CLI.

  1. In a track's directory, run the following command:

    instruqt track test

    ↳ Example output:

    ==> Finding track by slug: TEAM/TRACK_SLUG
    ==> Testing track 'TEAM/TRACK_SLUG' (ID: jum7k2jboetj)
        Creating environment ....... OK
    
    ==> Testing challenge [1/2] 'YOUR_CHALLENGE_NAME_1' (ID: pjdxmwz493v7)
        Setting up challenge              OK
        Running check, expecting failure  OK
        Running solve                     OK
        Running check, expecting success  OK
        
    ==> Testing challenge [2/2] 'YOUR_CHALLENGE_NAME_2' (ID: pjdxmwz493v8)
        Setting up challenge              OK
        Running check, expecting failure  OK
        Running solve                     OK
        Running check, expecting success  OK

Skip the checking steps

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.

instruqt track test --skip-fail-check

The "Running check" steps will fail if you do not have check scripts present in your track.

Keep tracks running after testing

instruqt track test --keep-running

Test in CI/CD pipelines

Set authentication

Docker Image

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.

🛤️
The Instruqt CLI
Check and solve scripts in your challenges
play.instruqt.com
image
create an API token