Skip to content
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

Allow filtering of specific tests #213

Closed
GeeWee opened this issue Oct 1, 2024 · 5 comments
Closed

Allow filtering of specific tests #213

GeeWee opened this issue Oct 1, 2024 · 5 comments

Comments

@GeeWee
Copy link

GeeWee commented Oct 1, 2024

This issue is based on the recent announcement that cargo-watch is going on life support and the recommendation to switch to bacon.

I currently use both cargo-watch and bacon - but I only use cargo-watch for one case anymore really, and that is re-running a specific test in a loop. Often I have a library and I just want to run one test until it's fixed, and not all the others. Currently I can't seem to find any support for this in bacon, apart from perhaps defining an entirely new job, which seems heavy-weight.

Would you consider adding a feature to allow passing filters to e.g. a test job, or does that functionality already exist and I just haven't been able to find the documentation for it?

@Canop
Copy link
Owner

Canop commented Oct 1, 2024

Do you mean selecting the test while in bacon, or in the command line ?

If it's at the CLI, then you can specify the test after --:

bacon test -- config::test_default_files

@GeeWee
Copy link
Author

GeeWee commented Oct 1, 2024

Optimally I would love to be able to select it in bacon, but specifying it at the CLI is also perfectly fine. I just had no idea I could do it! Is it documented anywhere? If not, I can look at creating a docs PR if you'd like :)

@Canop
Copy link
Owner

Canop commented Oct 1, 2024

Optimally I would love to be able to select it in bacon

This could maybe be a command to just run the failing test(s). I'll create an issue for that.

Is it documented anywhere? If not, I can look at creating a docs PR if you'd like :)

It's more or less explained here: https://dystroy.org/bacon/cookbook/#variable-arguments
The precise case of selecting the test should be made clearer, I'll improve that (if you want to create a PR, do it, but be conscious that it's very important in such doc to keep wording concise and not give too much importance to the detail you're concerned about at one moment).

@Canop
Copy link
Owner

Canop commented Oct 1, 2024

Also thanks @GeeWee for having told me about the cargo watch author announcement.

@GeeWee
Copy link
Author

GeeWee commented Oct 1, 2024

Sounds like you have a strong opinion on how the docs update should be done, so I'll leave it to you :)

@Canop Canop closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants