Skip to content

test(coverage): improve coverage and generate badge - #1799

Merged
John-David Dalton (jdalton) merged 1 commit into
v1.xfrom
test/coverage-99
Dec 4, 2026
Merged

John-David Dalton (jdalton) merged 1 commit into
v1.xfrom
test/coverage-99

Conversation

@jdalton

@jdalton John-David Dalton (jdalton) commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Socket CLI reaches 95.22% cumulative line coverage across source files instrumented by the unit and E2E Vitest runs. The E2E report does not collect hits from separately spawned bundled CLI processes. The README badge rounds the cumulative percentage to 95%.

The PR adds scenario-focused tests for CI status reporting, scan output, build-tool selection, and file and download failure recovery. The coverage badge is generated from the combined unit and E2E source reports.

Coverage

@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are limited to Vitest config, npm scripts, a README badge updater, and new tests—no production implementation files are modified in this diff.

Overview
Adds automated README coverage badges by extending Vitest with json-summary reporting (reportOnFailure), wiring pnpm run coverage:test to run scripts/coverage-badge.mts, and seeding marker-delimited badge HTML in README.md (currently 65%).

Expands unit tests across manifest (Gradle/sbt POM conversion, Conda outputRequirements, setupManifestConfig cancel/save flows), api.mts (polling 202s, auth/HTTP/JSON errors, sendApiRequest, SDK handleApiCall*, base URL and status helpers), and small utils (dlx shadowing, Yarn Berry detection, tildify, org plans, msAtHome), plus tests for the badge script itself. Reported line coverage moves from ~63.5% to ~65.4% without changing coverage excludes.

Reviewed by Cursor Bugbot for commit 169a92f. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort 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.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 169a92f. Configure here.

Comment thread scripts/coverage-badge.mts Resolved
@jdalton
John-David Dalton (jdalton) marked this pull request as draft December 2, 2026 00:50
@jdalton
John-David Dalton (jdalton) marked this pull request as ready for review December 2, 2026 00:51
@jdalton
John-David Dalton (jdalton) marked this pull request as draft December 2, 2026 00:55
auto-merge was automatically disabled December 2, 2026 00:55

Pull request was converted to draft

@jdalton
John-David Dalton (jdalton) force-pushed the test/coverage-99 branch 13 times, most recently from c534f1f to 66302cb Compare December 3, 2026 19:43
@jdalton
John-David Dalton (jdalton) marked this pull request as ready for review December 3, 2026 19:43
@jdalton
John-David Dalton (jdalton) force-pushed the test/coverage-99 branch 2 times, most recently from 2eb78ec to 3529308 Compare December 3, 2026 20:19
@jdalton
John-David Dalton (jdalton) force-pushed the test/coverage-99 branch 5 times, most recently from 0677de8 to 29b28f7 Compare December 3, 2026 21:46

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[agent] Four inline findings on the package lookup, coverage claim, and test tooling.

Comment thread src/utils/npm-spec.mts Resolved
Comment thread README.md Resolved
Comment thread test/unit/src/utils/oauth.test.mts Resolved
Comment thread scripts/coverage-badge.mts Resolved

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM! This is great lift for tests, thanks!

@jdalton
John-David Dalton (jdalton) merged commit 62c1aaa into v1.x Dec 4, 2026
19 of 23 checks passed
@jdalton
John-David Dalton (jdalton) deleted the test/coverage-99 branch December 4, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants