-
-
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
The cucumber.options system property should only override specified options. #388
Conversation
When setting the "cucumber.options" system property, all the cucumber options are overridden, including glue and feature path. This is an issue for junit for two reasons: - This is against the logic currently present in RuntimeOptionsFactory which sets glue and feature path to default values based on the JUnit test case if they are not set by @Cucumber.Options. - This makes the definition of cucumber.options in a Maven pom file awkward, as you have to re-define glue and feature path as a system property, even if you have correctly defined the path to the resource folder containing feature files.
I like what you have done here. I'd like this to behave the same for the CLI runner as well, not just when using the JUnit runner. Essentially - WDYT? |
I had actually started with a similar approach, but then backtracked as I thought that behaviour was actually desirable for CLI. If it isn't, then I am more than happy to push down the processing into |
Awesome! One thing to be aware of is tags. Let's assume the user has "--tags @foo" defined in the JUnit class or POM file. The tags would now be So if you go ahead with this it would proably be a good idea to throw an exception if tags are specified both in Other options should be fine to just overwrite (scalars) or append (lists). Later I'd really like to implement a tag logic parser so people can say |
My thinking was to ignore the tags (and other options, including glue and feature path) set in |
D'accord! |
This logic was originally implemented in the junit module, but to extend this behaviour to CLI, these changes are now pushed down into `RuntimeOptions`.
Aslak, I have now updated the code as per our discussion. Let me know if you require further changes. |
Thanks! I'll try it out when I have time. |
…ar values are clobbered. Filters (--tags, --names, --lines) clobbers previous filters (treated like a scalar). See #388.
Check my cucumber_options_improved branch. I made some changes after yours. Do you agree with this? |
You lose the ability of making it "non-strict" or "non-monochrome" by overriding with Tusen takk! (= |
Zut, I hadn't thought about that. In Cucumber-Ruby, boolean flags can be explicitly turned off with |
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. |
When setting the "cucumber.options" system property, all the cucumber options
are overridden, including glue and feature path. This is an issue for junit
for two reasons:
sets glue and feature path to default values based on the JUnit test case
if they are not set by @Cucumber.Options.
as you have to re-define glue and feature path as a system property, even if
you have correctly defined the path to the resource folder containing
feature files.