-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Bug 3840: --forbid-only doesn't recognize it.only
when before
crashes
#4256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Just a couple comments.
I think this is a bugfix.
it.only
when before
crashesit.only
when before
crashes
… done before runtime
This LGTM, but think @juergba should take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arvidOtt Thank you. I'm not sure wether the priorities are consistent.
- when an only-suite is not matched by grep, it does not throw?
- when an only-test is not matched by grep, it throws?
- when it does not throw when not matched by grep, then why should it throw when statically skipped?
What do you think? Do our docs tell anything about priorities?
Thank you @juergba, I agree that this is handled inconsistently. In the CLI Usage it is described:
as well as
I found nothing in the docs about priorities between only, grep or skip. |
Considering the usage of What is your opinion on that @juergba @boneskull? |
@outsideris you implemented
I could live with your proposition. We have to decide:
Easy solution: we leave the pending stuff as is, and don't think or ask too much. And we remove the grep check for only-suites. |
I agree that |
… is not selected by grep
@juergba @outsideris @boneskull I applied the following changes:
Concerning the handling of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty for updating. I'm sorry, I think I changed my mind. Yes, I do think --forbid-only
should throw an error even if --grep
is used. But I don't think it should be in this PR. Possible to revert that and submit another?
I'll merge this once it's pulled out. If you don't have the cycles, I can do it myself.
thanks!!
This reverts commit cffc71a.
@boneskull I reverted the commits concerning the refactoring of the suites handling of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty!
…; closes #3840 * add fixtures that result in it.only combined with --forbid-only bug * adapt forbidonly test cases to cover it.only bug * check if forbid only option is set prior to marking a test only and throw error * change name of only test back to previous * use custom assertion for expecting error in forbidOnly tests * remove empty line * use createUnsupportedError instead of throw new Error * use createUnsupportedError instead of throw new Error * remove check if suite hasOnly and forbidOnly option is set as this is done before runtime * implement markOnly instance method in suite class * add unit test for suites markOnly method * throw exception if --forbid-only option is set even if suite is not selected by grep * adapt forbidOnly integration tests to check for failure if only suite is not selected by grep * fix jsdocs of suite markonly * Revert "fix jsdocs of suite markonly" This reverts commit cffc71a. * Revert "adapt forbidOnly integration tests to check for failure if only suite is not selected by grep" This reverts commit 336425a. * Revert "throw exception if --forbid-only option is set even if suite is not selected by grep" This reverts commit f871782. * Revert "add unit test for suites markOnly method" This reverts commit c2c8dc8. * Revert "implement markOnly instance method in suite class" This reverts commit 4b37e3c.
Requirements
Description of the Change
Option
--forbid-only
crashes only in case of approaching describe.only but not it.only. Following the discussion in #3840 and the closed PR #3948 it was decided that this should be prevented at definition phase and not during runtime.This change checks if the
--forbid-only
option is set prior to marking a test to be only. This is the same point at which the check is done for the suite. The error message reported will be the same as for the suite. This change also adds integration test cases to cover the situation.Alternate Designs
Do the check at runtime like in PR #3948. This was explicitly discussed and not wanted.
Why should this be in core?
It fixes a bug.
Benefits
It fixes a bug.
Possible Drawbacks
Applicable issues
#3840