Tusk’s test generation agent is optimized for generating unit 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.
When a commit is pushed to a PR/MR, Tusk will look at the PR/MR details, existing tests and mocks, and other codebase context to generate tests for the happy path and edge cases.
2
Agent runs tests
Tusk will run these new tests in an isolated, ephemeral sandbox or via your Tusk test runner workflow to get the results.
3
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.
4
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:
5
Review test cases
Click View tests at the top of Tusk’s PR comment to view the generated test cases in the Tusk web app.If using GitHub, you can also view Tusk’s generated test cases in the GitHub check output page.
6
Examine test details
Review 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.
7
Add tests to PR/MR
In the Tusk web app, select the test cases you want, then click Commit X of Y tests. You can also create a separate PR/MR for the tests if you’d like to resolve failing tests separately.If using GitHub, you can click Incorporate tests from within the check output to add all generated tests to the PR/MR’s branch.
8
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.