-
-
Notifications
You must be signed in to change notification settings - Fork 82
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 a command to relaunch tests but limited to the failing one(s) #214
Comments
That would also be incredible - just like Jest's option to only rerun failing tests! |
A serious problem is that cargo test doesn't support specifying several tests to run. Either you run them all or you run all the ones which contain a specific string. So if I want an easy scoping feature, it would run only when there's only one failure. Or when using nextest. |
Tests of the PR welcome! |
I did a bit of digging, and I think a potential workaround might be to:
I'm not 100% if you'll run into issues with command length if you have a lot of tests, but it's at least a possible avenue. |
@GeeWee Oh, I missed that. It's interesting. |
Of course, nextest doesn't support it, which makes it hard to support in a generic way ^^ A skip logic is also very painful in other ways (for example it makes it impossible to serialize the mission order, or to pass it at command line) and would have to be tested on projects with thousands of tests. So I'll probably merge the current PR as is (when scoping, you're usually interested in your new failing test anyway) and postpone using (or not) |
# In short If you ran a test job, and there's a failure, hit <kbd>f</kbd> to have the job "scoped" to the failures, ie not executing other tests. If you want to go back to all tests, hit <kbd>esc</kbd>. Fix #214 # Details `cargo test` doesn't support passing several test keys, so scoping only takes the first failure. If you're running another test command, for example `cargo nextest run`, then all failures are part of the scope. It's possible to start bacon in scoped mode: `bacon test(mymodule::some_fun)`. Hitting <kbd>esc</kbd> will bring you to the unscoped tests. If you want to define a different binding (maybe you're already using the <kbd>f</kbd> key), you can refer to the `scope-to-failures` internal. For example: ``` [keybindings] alt-f = "scope-to-failures" ```
I think that's a good call :) |
(follows issue #213 and discussion with @GeeWee)
The idea would be to hit a key and have the same test/nextest/whatever job relaunched but scoped to the failing test(s).
Hitting escape would take you back to all tests.
The text was updated successfully, but these errors were encountered: