Use the simplecov 1.x spellings, and replace track_files with cover - #421
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.