Skip to content

CoverBot: Increased coverage for cmd/ package files with high churn and bug-fix history#225

Open
tusk-dev[bot] wants to merge 1 commit intomainfrom
tusk-coverbot-cmd-files-2026-04-16-160003
Open

CoverBot: Increased coverage for cmd/ package files with high churn and bug-fix history#225
tusk-dev[bot] wants to merge 1 commit intomainfrom
tusk-coverbot-cmd-files-2026-04-16-160003

Conversation

@tusk-dev
Copy link
Copy Markdown
Contributor

@tusk-dev tusk-dev bot commented Apr 16, 2026

This PR contains 49 unit tests across 2 test files.

CoverBot config: cmd files

File patterns: cmd/**

Why these files?

CoverBot targeted cmd/run.go and cmd/unit_helpers.go based on coverage gaps and git history. cmd/run.go started at 10.4% coverage with the highest churn in cmd/ (23 commits in 3 months) and 8 bug-fix commits, making it a high-risk file. cmd/unit_helpers.go jumped from 27.9% to 85.3% coverage with CoverBot's tests, covering pure string-parsing functions like parseRepoSlugFromRemote with multiple code paths. Both files contain well-isolated, testable symbols requiring no external API or TUI mocking, enabling stable, maintainable tests.

Reviewers

Tagged @sohil-kshirsagar — 8+ commits to cmd/run.go covering CI status logic, coverage handling, and error handling in cloud mode. Tagged @jy-tan — multiple commits to cmd/run.go for sandbox mode, branch/commit SHA env var handling, and JSON output logic.

Files tested

  • cmd/run.go
  • cmd/unit_helpers.go
Avg +33% line coverage gain across 2 files
Source file Line Branch
cmd/run.go 18% (+8%)
cmd/unit_helpers.go 85% (+57%)

Coverage is calculated by running tests directly associated with each source file, learn more here.


View test details on Tusk ↗

@tusk-dev tusk-dev bot requested review from jy-tan and sohil-kshirsagar April 16, 2026 16:18
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f00c45f. Configure here.

Comment thread cmd/run_test.go
require.Equal(t, "77", meta.PRNumber)
require.Equal(t, "gl-feature", meta.BranchName)
require.Equal(t, "pipeline-999", meta.ExternalCheckRunID)
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitLab test missing GitHub env var cleanup

Medium Severity

TestValidateCIMetadata_GitLab "GitLab CI populates metadata from env vars" doesn't clear GITHUB_HEAD_REF or GITHUB_REF_NAME via t.Setenv. Since getBranchFromEnv() checks these GitHub env vars before the GitLab ones (without gating on GITHUB_ACTIONS), when this test runs on GitHub Actions — where those vars are set by the runner — the branch resolves to the GitHub value instead of "gl-feature", causing the require.Equal assertion to fail. The TestGetBranchFromEnv tests correctly clear both vars when testing GitLab paths, but this test does not.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f00c45f. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants