Skip to content

Use the simplecov 1.x spellings, and replace track_files with cover - #421

Merged
JonJagger merged 1 commit into
mainfrom
simplecov-1x-spellings
Aug 27, 2026
Merged

Use the simplecov 1.x spellings, and replace track_files with cover#421
JonJagger merged 1 commit into
mainfrom
simplecov-1x-spellings

Conversation

@JonJagger

Copy link
Copy Markdown
Member

The base image now carries simplecov 1.1.1 where it carried 0.21.2.
Three spellings are deprecated there, each announcing itself on stderr
on every run:

add_group     -> group
track_files   -> cover
# :nocov:     -> # simplecov:disable / # simplecov:enable

and the formatter reopened SimpleCov::Formatter::JSONFormatter to
redefine format, which in 1.1.1 makes ruby -w report the redefinition.
It is now CoverageMetricsFormatter, named for the coverage_metrics.json
it writes. What it produces is per-group totals, not the per-file shape
the shipped formatter writes, so it was only borrowing the name to make
itself win.

track_files -> cover is not a rename, and the deprecation message's own
suggested replacement is wrong for us. It echoes back the absolute glob,
which track_files needed because it globbed disk, and which cover
matches nothing with: cover is relative to root on both sides, since
SourceFile#project_filename strips the root and its leading slash, and
the disk sweep is Dir.glob(glob, base: root).

cover also does a second job. It restricts the report to what it names,
so naming only source/ empties the test group. Naming test/ as a glob
does not fix it either: a string glob drives the disk sweep, which pulls
in the browser and client tests this run never loads and reports 563 of
their lines as missed. Only string globs drive that sweep, so the test
tree is named as a regexp: restriction without discovery.

Two of those three wrong answers zeroed a group. They were caught
because the limits here have lower bounds - 1 <= value - rather than
ceilings alone. A gate with ceilings only would have read 0 and passed.

Coverage is unchanged: code 496 lines / 33 branches, test 1431 / 22,
nothing missed in either.

  The base image now carries simplecov 1.1.1 where it carried 0.21.2.
  Three spellings are deprecated there, each announcing itself on stderr
  on every run:

    add_group     -> group
    track_files   -> cover
    # :nocov:     -> # simplecov:disable / # simplecov:enable

  and the formatter reopened SimpleCov::Formatter::JSONFormatter to
  redefine format, which in 1.1.1 makes ruby -w report the redefinition.
  It is now CoverageMetricsFormatter, named for the coverage_metrics.json
  it writes. What it produces is per-group totals, not the per-file shape
  the shipped formatter writes, so it was only borrowing the name to make
  itself win.

  track_files -> cover is not a rename, and the deprecation message's own
  suggested replacement is wrong for us. It echoes back the absolute glob,
  which track_files needed because it globbed disk, and which cover
  matches nothing with: cover is relative to root on both sides, since
  SourceFile#project_filename strips the root and its leading slash, and
  the disk sweep is Dir.glob(glob, base: root).

  cover also does a second job. It restricts the report to what it names,
  so naming only source/ empties the test group. Naming test/ as a glob
  does not fix it either: a string glob drives the disk sweep, which pulls
  in the browser and client tests this run never loads and reports 563 of
  their lines as missed. Only string globs drive that sweep, so the test
  tree is named as a regexp: restriction without discovery.

  Two of those three wrong answers zeroed a group. They were caught
  because the limits here have lower bounds - 1 <= value - rather than
  ceilings alone. A gate with ceilings only would have read 0 and passed.

  Coverage is unchanged: code 496 lines / 33 branches, test 1431 / 22,
  nothing missed in either.
@JonJagger
JonJagger merged commit 0778cf3 into main Aug 27, 2026
10 checks passed
@JonJagger
JonJagger deleted the simplecov-1x-spellings branch August 27, 2026 14:41
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