Skip to content

Cover the additions that shipped this month without specs - #2172

Open
bbatsov wants to merge 1 commit into
masterfrom
test/cover-recent-additions
Open

Cover the additions that shipped this month without specs#2172
bbatsov wants to merge 1 commit into
masterfrom
test/cover-recent-additions

Conversation

@bbatsov

@bbatsov bbatsov commented Aug 24, 2026

Copy link
Copy Markdown
Owner

I measured function-level coverage by instrumenting the suite - advising every defun and running all the specs. 87.8%, with 102 functions never called. Four of those were mine, added over the past week: the go.work parser, the two sibling wrapper commands, and the dispatch wrapper that translates the search switches.

Writing the first spec found a bug in the very parser it was covering. A go.work names its modules as ./api, and that leading ./ survived into the subproject name, which then matched none of the project's file paths - so projectile-find-file-in-subproject offered nothing in a Go monorepo:

subprojects:      ("./api/")
project files:    ("api/go.mod" "api/main.go" "go.work")
restrict to sub:  nil          <- what c m f offered

Expanded members are now spelled relative to the project root whatever the manifest wrote. The pnpm, npm and Cargo manifests never produce that spelling, which is exactly why their specs passed and Go - having none - shipped broken.

88.3% after this.

Instrumenting the suite - advising every defun and running all 1474
specs - put function coverage at 87.8%, with 102 functions never called.
Four of the misses were mine, added over the past week: the `go.work'
parser, the two sibling wrapper commands, and the dispatch wrapper that
translates the search switches.

Writing the first of those specs turned up a bug in the parser it was
covering.  A `go.work' names its modules as `./api', and the leading
`./' survived into the subproject name, which then matched none of the
project's file paths: `projectile-find-file-in-subproject' offered
nothing whatsoever in a Go monorepo.  Expanded members are now spelled
relative to the project root, whatever the manifest wrote - the pnpm,
npm and Cargo manifests never produced such a spelling, which is why
their specs passed and Go had none.

Coverage is 88.3% after this, and the specs the other three needed are
the kind that would have caught it.
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.

1 participant