not tags and cucumber.options on the command line

1,878 views
Skip to first unread message

Paul Bender

unread,
Dec 12, 2017, 11:15:52 AM12/12/17
to cu...@googlegroups.com
Hello,

I'm working on upgrading a java project from version cucumber-jvm-1.2.5
to cucumber-jvm-2.0.1. We run a few cucumber tests through the JUnit
runner along with a large suite of JUnit tests.

On the first build after upgrading, I received a warning about "~@tag"
being removed and should be replaced replaced with "not @tag".
Replacing that was no problem where the tag option is specified in the
source code.

Where I am having a problem is that we have been overriding the default
cucumber tag options through maven with a command line such as:

mvn -Dcucumber.options="--tags ~@Ignore" -Dtest=jmri.RunCucumberTest test

which of course spits out the same warning as the ~ in the junit runner
file, but changing that to:

mvn -Dcucumber.options="--tags not @Ignore" -Dtest=jmri.RunCucumberTest test

results in the TagExpressionException below.

So how exactly are we supposed to specify "not tag" on the command line?

Thanks,
Paul


[ERROR] initializationError(jmri.RunCucumberTest) Time elapsed: 0.028 s
<<< ERROR!
io.cucumber.tagexpressions.TagExpressionException: empty stack
at
io.cucumber.tagexpressions.TagExpressionParser.pop(TagExpressionParser.java:76)
at
io.cucumber.tagexpressions.TagExpressionParser.pushExpr(TagExpressionParser.java:91)
at
io.cucumber.tagexpressions.TagExpressionParser.parse(TagExpressionParser.java:65)
at cucumber.runtime.TagPredicate.<init>(TagPredicate.java:28)
at cucumber.runtime.Runtime.<init>(Runtime.java:69)
at cucumber.runtime.Runtime.<init>(Runtime.java:45)
at cucumber.runtime.Runtime.<init>(Runtime.java:41)
at cucumber.api.junit.Cucumber.createRuntime(Cucumber.java:84)
at cucumber.api.junit.Cucumber.<init>(Cucumber.java:63)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at
org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at
org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at
org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:362)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:236)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)
at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)

Marit van Dijk

unread,
Dec 12, 2017, 2:43:19 PM12/12/17
to Cukes
Hello Paul,

I think you need to use quotation marks, like so:
mvn test -Dcucumber.options='--tags "@smoke and @fast"'

Regards,
Marit

Paul Bender

unread,
Dec 13, 2017, 12:13:54 AM12/13/17
to cu...@googlegroups.com
On 12/12/2017 02:43 PM, Marit van Dijk wrote:
Hello Paul,

I think you need to use quotation marks, like so:
mvn test -Dcucumber.options='--tags "@smoke and @fast"'

Thanks, that solved the problem.

I had tried escaping the nested quotes before I sent my initial message, but I hadn't tried using a different type of quote.


Paul
Reply all
Reply to author
Forward
0 new messages