New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --filter-status failed for running only failed tests from the last completed run #483
Add --filter-status failed for running only failed tests from the last completed run #483
Conversation
I dislike two things about the current solution:
I've got the feeling that there is a more minimal/modular solution lurking under the surface: Splitting the recording and "replay" functionality into separate flags would allow for 2. Similarly, it might be a good idea to record all tests that ran, and save their state as failing/passing, then a replay run can skip all passed tests and run those that failed or were not run. |
4ed0e91
to
454ac25
Compare
I think it might be a good idea to implement it as a list of test names with the pass and fail state. That would be much simpler than splitting the feature into two options and would solve the problem of the test run being cancelled (or the problem of new tests being added between However, the file creation logic and lifetime is a little bit worrisome. You can't use Ideally we would always record the test results and then when Also IMHO the option name is somewhat confusing (are we retrying a test immediately after it failed?). |
Yes, I was thinking about this too. The current state just was an implementation shortcut because the format already works with the internal test list. We also would have to make sure that the test names are parsable from on line.
No, I'd actually like to update the file.
I was torn on where to put it too. I am not sure if
I tried to avoid creating the failed test log unconditionally to not force it unto unsuspecting users with the new version. A middle ground might be to require explicit approval on first run. I am not sure if this is a feature of interest for CI systems. I could envision exporting the failed test log as an artifact for download, so you can streamline your local error search or later runs. Anyways, my idea of --rerun-failed semantics would be to narrow down the list of failing tests incrementally, so each new complete run would capture more detail. I think solution that only overwrites with a new capture if the test suite completed would be good enough for now. This can be improved later on. However, the interface should not change. |
@cyphar Some more ideas: We could require the user to create the |
@cyphar After some experimenting and reading over your comment again I have the following suggestion:
|
0ae9776
to
deced7c
Compare
0f4a408
to
6447096
Compare
@cyphar Please have a look on the UX again (code is obviously broken, since the tests are failing). I rewrote it with the following changes:
You can also have a look at the tests to see how it is intended to be used. |
which was required Bash pre 4.3
they are only useful in exec-suite
6447096
to
d5b0830
Compare
9cc7ddb
to
ab0614f
Compare
specify format that is understood by all target systems
ab0614f
to
97c8df4
Compare
Often only a little subset of tests is failing. While working on fixing them, running other tests just takes up time. While the filtering function can be used to filter down to a small number of tests, it can become cumbersome to select all tests that failed. This flag to Bats introduces that feature. What this PR does:
--filter-status
is activated it picks the most recent log in .bats/run-logsTODO:
documentation
I have reviewed the Contributor Guidelines.
I have reviewed the Code of Conduct and agree to abide by it