-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Return exit code 0 when no features are found, or no found features match the tags filter #567
Conversation
Return exit code 0 when no features are found, or if no found features match the tags filter used. Print the same message, that is used in the currently thrown CucumberException when this occurs, as information before the summary printout.
Jenkins will mark a job as failed even though the exit code was 0, if the JUnit report file contains no testcase elements. Therefore add a dummy testcase element to the JUnit report, when no features are found, or no found features match the tags filter used.
I don't think this is the proper solution for this. If there are no tests, or it can't find anything it should be a "failure" because you didn't actually test anything. It probably shouldn't barf an exception, but it shouldn't exit cleanly. That's my $0.02. Using the "--wip" option will invert this (IIRC), so if no tests are found it'll exit 0 |
@@ -103,7 +103,7 @@ public StepDefinitionMatch stepDefinitionMatch(String uri, Step step, I18n i18n) | |||
@Override | |||
public void writeStepdefsJson(List<String> featurePaths, URL dotCucumber) throws IOException { | |||
if (dotCucumber != null) { | |||
List<CucumberFeature> features = load(new FileResourceLoader(), featurePaths, NO_FILTERS); | |||
List<CucumberFeature> features = load(new FileResourceLoader(), featurePaths, NO_FILTERS, null); |
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.
What is that null for?
Can you just overload the method?
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.
You are right, overloading is better.
@dkowis On the other hand, Cucumber-Ruby treat it like a success and return exit code 0 in this case. And as far as I know is the "--wip" option not implemented in Cucumber-JVM. |
Ah, I am indeed mistaken. I could've sworn it used to work that way... Very well, this is probably the proper way to do it then. I withdraw my previous objections. |
Overload CucumberFeature.load to avoid passing null and the need for null check. Improve the log message when no feature path is given at the command line.
when there are no features found at all.
@brasmusson Could you, please, merge in your branch code from my branch with the same name? P.S. |
@brasmusson Here is a little manual how to do what I'm asking for:
Thanks |
LGTM! |
@ffbit I reckon that for you to be able to yourself add commit to my pull request, you would need push access to my forked Cucumber-JVM repository. Of course there is always the possibility that you create a PL from your succeed-on-no-features branch to the succeed-on-no-features branch on my forked repository, when that PL is merged, then the commit should be added to this PL. But it seems easier if a fetch the code from your branch and add it to this PL. I'll do that right now ... |
Merge pull request cucumber#567 Return exit code 0 when no features are found, or no found features match the tags filter. Update the History.md.
Merge pull request cucumber#567 Return exit code 0 when no features are found, or no found features match the tags filter. Update the History.md.
Merge pull request #567 Return exit code 0 when no features are found, or no found features match the tags filter. Update the History.md.
This is already really old, but: |
Currently, my Jenkins builds are overflowing with these 'dummy' results which is really annoying. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR is created in response to the following discussion on the mailing list:
[JVM] Exception thrown when no tags are found (https://groups.google.com/forum/#!topic/cukes/wZo0FTQJrVA).
Return exit code 0 when no features are found, or if no found features match the tags filter used. Print the same message, that is used in the currently thrown CucumberException when this occurs, as information before the summary printout.
Jenkins will mark a job as failed even though the exit code was 0, if the JUnit report file contains no testcase elements (http://jenkins.361315.n4.nabble.com/Jenkins-fails-if-there-are-no-testcases-td3899185.html). Therefore add a dummy testcase element to the JUnit report, when no features are found, or no found features match the tags filter used.