Overview
Generate unit and integration tests for your PRs/MRs
Demo
Tusk’s test generation agent is optimized for generating unit and integration tests for your code changes. Increase your code coverage with high-impact tests that check for edge cases.
For engineering teams with a testing culture, this feature helps to cut down on the time spent writing good tests, which make up 25-50% of the time spent on a PR/MR.
How Tusk Works
Agent generates tests
When a commit is pushed to a PR/MR, Tusk will look at the PR/MR details, existing tests and mocks (if any), and codebase context to generate tests for the happy path and edge cases.
Agent runs tests
Tusk will run these new tests in an isolated, ephemeral sandbox to get the results.
Agent self-iterates
If any tests fail and Tusk determines that the failure is due to an error in the test code, Tusk will self-iterate to fix the test code.
View results
Once the PR/MR check is complete, Tusk will leave a self-updating comment with a summary of the tests generated as well as the check history.
GitHub:
GitLab:
Review test cases
Click View tests or go to the check’s Details to view Tusk’s generated test cases.
You can also view the test cases in the Tusk web app by clicking Go to Tusk.. at the top of the check output. For GitLab users, this is the default view for managing Tusk’s generated tests.
Examine test details
You can view the test code and justification for each test case, whether it passed or failed, the test execution logs, as well as potential fixes for failing tests.
Add tests to PR/MR
Click Incorporate all to add all of the tests to the PR/MR. If you’d like to add only a subset of the Tusk tests, go to the Tusk UI and select the symbols you’d like to add tests for before clicking Incorporate all.
Agent commits tests
You will see a new commit in the PR/MR with the Tusk tests added. Good to go!
GitHub:
GitLab:
Questions? Reach out to support@usetusk.ai. We will respond as soon as possible.
Coming Up
-
Ability to backfill tests for existing code ✅
-
API tests ✅
-
Maintaining existing tests
-
Self-serve set up for new test execution environments
Was this page helpful?