fix(cli): fail fast on an unusable bootstrap or report path#876
Merged
Conversation
Both were accepted without a check, the work they configured was skipped,
and the run still exited 0.
--env missing.sh sourced unchecked: leaked a raw 'No such file or
directory', ran no tests at all, exit 0
--report-json <bad> suite passed, redirect failed after the fact, no
report on disk, exit 0 -- a CI job uploads an
empty artifact from a green build
The bootstrap is checked before it is sourced; the report destinations
are checked up front against the resolved configuration, so the failure
is reported before the suite runs rather than after it has passed.
--seed joins the other numeric options in being validated.
Closes #875
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.
🤔 Background
Related #875
Third in the same class as #871 and #873: an unusable path was accepted, the work it
configured was skipped, and the run still reported success.
--env missing.shwas sourced unchecked — it leaked a rawNo such file or directory,ran no tests at all, and exited
0. An unwritable report destination produced apassing suite, no file on disk, and exit
0, so a CI job uploads an empty artifact froma green build.
💡 Changes
--env/--bootbootstrap is readable before sourcing it, and error with a non-zero exit when it is not--report-json,--log-junit,--report-tap,--report-html,--log-gha) up front against the resolved configuration, so an unwritable path fails before the suite runs rather than after it has passed--seedas a non-negative integer, matching the options covered in fix(cli): validate option values instead of dropping bad ones #874