Repository navigation
fix: fail check-coverage when there is no coverage data to check - #614
Open
haigou-web wants to merge 1 commit into
Open
haigou-web wants to merge 1 commit into
haigou-web wants to merge 1 commit into
Conversation
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.
Fixes #610
Problem
With no coverage data at all,
--check-coverageexits 0:Two separate gaps:
pctas the string"Unknown"when there is no data, and"Unknown" < 100isfalse— the threshold check silently passes.--per-file,map.files()is empty, so theforEachnever runs and nothing is checked at all.Fix
"Unknown"as failing any threshold above 0--per-file, fall back to the overall summary when there are no filesNote on an existing test
exits with 0 if coverage within thresholdused--exclude="test/fixtures/*.js", which excluded the only file thebeforehook had instrumented. That test was relying on the bug: it was asserting "no data → exit 0" while its name says "coverage within threshold → exit 0". I changed the exclude totest/fixtures/all/**so the test actually exercises its stated intent.Verification
--per-file(exit 1), no data + threshold 0 (exit 0)monocart/--extensionrelated and fail identically on an unmodified checkout