
Overview
Tusk generates unit tests for your code in 3 main ways:- PR/MR check, which is triggered when a PR/MR (draft or otherwise) is raised or a new commit is pushed to the PR/MR’s branch. This is a non-blocking check by default, akin to AI code review but with the added benefit of scaling your testing infra. Read more.
-
Manual trigger, which requires you to add the
Tusk - Generate TestsGitHub/GitLab label to the PR/MR. This label is automatically created when you connect Tusk to your GitHub organization or GitLab group/project. - CoverBot, a scheduled pipeline that runs daily or weekly and automatically raises a PR/MR with unit tests that help backfill coverage for untested parts of your repo. This is an async workflow that occurs at a fixed interval. Read more.
PR Check
Committing to PR Branch
Create a PR

Tusk generates tests

Review Tusk's tests

Commit Tusk's tests

Fix failing tests
[Tusk] FAILING TEST comment in the test file for ease of reference.Engineer re-runs the test file to make sure the failing test now passes, removes the [Tusk] FAILING TEST comment, and pushes the fix.Merge the PR
Creating a Separate PR
Create a PR
Merge the PR with the hotfix
Tusk generates tests

Create separate Tusk PR

Fix failing tests
[Tusk] FAILING TEST comment in the test file for ease of reference.Engineer re-runs the test file to make sure the failing test now passes, removes the [Tusk] FAILING TEST comment, and pushes the fix.Approve and merge the Tusk PR

Manual Trigger
Testing an Open PR
Edit preferences
Disable automatic test runs
Create a PR
Trigger test generation
Tusk - Generate Tests GitHub/GitLab label to the PR/MR to generate unit tests for your changes.
Tusk generates tests
Commit Tusk's tests
Fix failing tests
[Tusk] FAILING TEST comment in the test file for ease of reference.Engineer re-runs the test file to make sure the failing test now passes, removes the [Tusk] FAILING TEST comment, and pushes the fix.Merge the PR
Backfill for Past PR
Find a past PR
Trigger test generation
Tusk - Generate Tests GitHub/GitLab label to the PR/MR to generate unit tests for the code changes.Tusk generates tests
Create separate Tusk PR
Fix failing tests
[Tusk] FAILING TEST comment in the test file for ease of reference.Engineer re-runs the test file to make sure the failing test now passes, removes the [Tusk] FAILING TEST comment, and pushes the fix.Approve and merge the Tusk PR
CoverBot
CoverBot runs on schedule
CoverBot creates a PR
Review CoverBot's tests
Modify tests (optional)
Handle detected bugs (optional)
Merge the CoverBot PR