Behavior change: produce a non-zero exit code (4) if no tests were run #1646
Closed
sunshowers
announced in
Announcements
Replies: 2 comments 1 reply
-
The behavior has been changed in #1881. I'll keep this issue until a bit longer after the next nextest release. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This behavior change has been implemented as of cargo-nextest 0.9.85. I did a brief survey of some GitHub issues and it looks like there was some minor breakage, but in general people seemed to understand the rationale behind the change. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
All but the simplest of projects have at least one test, and expect each invocation of nextest to run at least one test. Running zero tests likely indicates some kind of configuration issue.
Note that this is not a real error, so we're choosing to use the advisory exit code 4. Exit code 1 is for unexpected errors, 2 is for parsing errors, and 3 often has a specific meaning as well. 4 is the smallest unreserved code and fits this use case well.
Per our stability policy, this counts as a behavior change and will follow the rules outlined there, with a 3 month period. I don't anticipate any particular issues here -- some CI might break but it'll be correctly so.
Note that the behavior change is only for cargo nextest run, not list.
Update 2024-08-19
Based on feedback, we're going to make this a CLI option called
--no-tests
with three possible values:The
--no-tests=warn
andpass
is meant for cases likecargo hack --feature-powerset nextest run
, where some combinations of features can lead to no tests being run in an expected manner.See #1648.
Timeline
Beta Was this translation helpful? Give feedback.
All reactions