Self-Serve
Run Tusk-generated tests on a GitHub Actions runner
Before you begin, make sure that you meet these requirements:
- Use GitHub for version control (GitLab not currently supported for self-serve)
- Use Python, JavaScript, or TypeScript in your repo
- Have GitHub
admin
access to manage secrets or variables for your repo
Overview
To surface meaningful and validated tests, Tusk needs to execute the tests it generates against your commit with your specific project’s dependencies.
Most engineering teams already have existing CI pipelines for running their unit test suites, most commonly with GitHub Actions.
Our self-serve flow allows you to provision a GitHub Actions runner as an ephemeral sandbox, enabling you to piggyback off of your existing workflow setup and granting you greater control over the configuration.
Using Tusk via self-serve will accrue GitHub Actions minutes for your organization. GitHub provides a generous amount of free minutes but a single Tusk test generation run can cost $0.16-0.32 depending on which runner you use. More on GitHub Actions billing here.
Set-Up Instructions
Go to Repos page
In the Repos page, click Setup test environment under the synced repo that you would like to set up a test environment for.
Name your test environment
Give your new test environment a name (e.g., backend unit tests, Jest frontend tests). Different microservices require different test environments, and frontend would need a separate one to backend, so this helps you identify them.
Create the Tusk GitHub workflow
Pick between using the Tusk template for the GitHub Actions workflow file (Option 1) or creating the workflow file manually (Option 2).
We recommend going with Option 1 and clicking Create PR with template.
Review the Tusk GitHub workflow PR
If you chose Option 1, click the URL to view the PR for the Tusk GitHub workflow. The workflow file will contain your test environment’s name.
You will still need to modify the workflow file to customize it to your project (e.g., app directory, test framework, RegEx for matching test files)
Create Tusk API key
In the Tusk set-up wizard, create an API key under the “Confirm Tusk API Key” section. Make sure to copy the API key on first creation and add it to your repo’s secrets.
Merge the Tusk GitHub workflow PR
Once you’ve modified and approved the Tusk GitHub workflow PR, merge the PR.
Select the workflow file
In the Tusk set-up wizard, click Refresh under the “Select workflow” step. Then, select the Tusk GitHub workflow file you just merged. Click Continue.
Verify the Tusk GitHub workflow
Choose the branch to test the Tusk GitHub workflow on and then paste in file paths of existing test files in the repo. We recommend including at least 2 test files (use comma-separated values).
Click Verify workflow to run the test run. You should see Tusk attempt to verify that the workflow runs as expected.
Complete test environment set-up
Click Finalize configuration once the Tusk GitHub workflow passes all steps. Now, enable seats to start seeing test generation on your PRs. 🎉
FAQs
Was this page helpful?