CoverBot is in beta. Reach out to your Tusk representative or support@usetusk.ai to get access.

Overview

Tusk CoverBot runs as a scheduled daily, weekly, or monthly cron job and generates unit tests for recently modified files with low line coverage.

Think of this as Dependabot but for increasing unit test coverage across your repo.

CoverBot is complementary to the Tusk CI workflow which is triggered per commit to a PR. This feature is best suited for engineering organizations that have set unit test coverage goals.

Requirements

You need the following to begin using CoverBot:

  • Team Plan and up
  • Enabled repo in Tusk
  • Working Tusk test execution environment

If you are already using Tusk to generate unit tests via CI, you meet all the requirements.

Reach out to the Tusk team via Slack or at support@usetusk.ai with your CoverBot schedule in mind (e.g., every Monday at 9am Pacific Time) to enable the feature.

How CoverBot Works

CoverBot is an async workflow so it is fully hands-off for your engineering team.

  1. At your pre-determined schedule (daily/weekly/monthly at set time), CoverBot creates a branch off of your default branch
  2. CoverBot runs a coverage script and finds recently modified files that have low line coverage
  3. CoverBot generates unit tests for the files and iterates on them to make sure they are passing and fully executable
  4. CoverBot creates a PR/MR with the line/branch coverage gains and test case details in the PR/MR description
    • If no tests are generated, CoverBot deletes the branch from Step 1
  5. CoverBot assigns the PR/MR to the engineer who is in charge of reviewing Tusk PRs
  6. Assigned engineer reviews the PR/MR and approves the tests if no changes required
  7. Assigned engineer merges the PR/MR
CoverBot is triggered on a test execution environment level. For example, if you’ve enabled CoverBot for two separate environments (e.g., frontend unit tests, backend unit tests), the bot will raise 2 separate PRs.

FAQs