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

Abort on active rspec --focus option #123

Closed
mockdeep opened this issue Oct 16, 2013 · 14 comments
Closed

Abort on active rspec --focus option #123

mockdeep opened this issue Oct 16, 2013 · 14 comments

Comments

@mockdeep
Copy link
Contributor

When I add the following config to my spec_helper file all mutations fail except the noop:

config.filter_run :focus => true
@mockdeep
Copy link
Contributor Author

I don't have any specs tagged with focus: true.

@mbj
Copy link
Owner

mbj commented Dec 1, 2013

This is expected behavior and the way rspec works. I cannot fix it?

@mbj mbj closed this as completed Dec 1, 2013
@mockdeep
Copy link
Contributor Author

mockdeep commented Dec 2, 2013

@mbj Why is this expected? I don't see why mutant should be incompatible with some rspec configurations.

@mbj
Copy link
Owner

mbj commented Dec 2, 2013

@mockdeep Rspec filters example groups internally when :focus is enabled. Mutant does not "see" non-focus examples in that case. I'm already hooking deep into rspec, and I'd dislike this. I'll come up with a totally different integration scheme soon, that will probably fix these issues. Ideas are already there.

@mockdeep
Copy link
Contributor Author

mockdeep commented Dec 2, 2013

@mbj Is this the case when no examples are focused, though? I haven't marked any examples as focused, I've just enabled the configuration setting in spec_helper.

@djbender
Copy link

djbender commented May 7, 2014

this bit me too, maybe a bit in the README would help?

@mbj
Copy link
Owner

mbj commented May 7, 2014

@djbender We should add a note to the README, and we could peek into active rspec configuration to make mutant complain when this flag was set. I'd accept PRs for both.

I'll not close this issue until mutant complains when rspec is in invalid state for mutant integration.

@mbj
Copy link
Owner

mbj commented May 7, 2014

@djbender I meant: Do you wana PR the README change?

@mbj mbj reopened this May 7, 2014
@djbender
Copy link

djbender commented May 7, 2014

When I get some free time I'll take a look!! thanks for the quick response.

@mbj mbj added the enhancement label Jun 8, 2014
@mbj mbj changed the title Doesn't seem to work with rspec focus option Abort on active rspec --focus option Aug 8, 2015
@backus
Copy link
Contributor

backus commented Aug 17, 2021

Not usually one to bump issues, but I got burned by this for like an hour since I had a totally unrelated spec focused and mutant reports the selected tests as having run. Would good be a nice thing to fix. I'd be happiest with something that aborts if the selected tests gets filtered down to zero when focus filter is applied

@mbj
Copy link
Owner

mbj commented Aug 17, 2021

@backus same here, so will definitively add it soon thanks for bumping. I'm getting more and more mutant time recently.

@mbj mbj closed this as completed in d372b30 Aug 30, 2021
@mbj
Copy link
Owner

mbj commented Aug 30, 2021

8y ;)

@mbj
Copy link
Owner

mbj commented Aug 30, 2021

@backus, @dgollahon

I opted for doing something "generic", not scoped to rspec/minitest integrations but simply: Whenever you request mutant to run on 0 effective tests: It prints a nice warning message aborting early.

Next step is to print the message on 0 selected tests.

@mbj
Copy link
Owner

mbj commented Aug 30, 2021

@backus it could actually be you need a slight change from what I did, in making mutant complain on having 0 selected tests, as the focus option may keep 1-2 tests of 1k in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants