The new multi-token expression syntax makes it impossible to declare multi token tag expression in the --tags flag inside the -Dcucumber.options flag in maven-surefire-plugin configuration.
It should be possible possible to pass multi token tag expression in the -Dcucumber.options flag.
maven-surefire-plugin crashes throwing either VM crash, IllegalArgumentException or doesn't run any tests depending on the input.
Make it possible to make single token tag expression without any whitespace characters.
mvn testMy use case is injecting tag expression from parent pom.
Try:
<argLine>-Dcucumber.options="--tags 'not @ignored'"</argLine>
I entered that flag slopily in the description.
I have already tried your suggestion, but it doesn't work. If you don't believe me, I can make a minimal example project.
Please do. I copied that out of an existing project.
Bad call - I cannot reproduce it in a minimal example. I must a have problem in a configuration then.
Thank you very much.
Are you using multiple tags by any chance?
Just a negation.
I have tried different configurations using my minimal example and I came to the following conclusion.
Cucumber only works with maven-surefire-plugin version in the range [2.12.2, 2.12.4]. Even the newer versions of cucumber have this implicit requirement. Lower and higher version than in this range causes the maven-surefire-plugin to not read the command line properly or crash with an error: /bin/sh: 1: Syntax error: Unterminated quoted string.
Differences between versions:
2.11: /opt/java/jdk1.8.0_191/jre/bin/java '-Dcucumber.options=--tags 'not @ignored''
2.12: /opt/java/jdk1.8.0_191/jre/bin/java '-Dcucumber.options=--tags 'not @ignored''
2.12.3: /opt/java/jdk1.8.0_191/jre/bin/java '-Dcucumber.options=--tags '\''not @ignored'\'''
2.13: /opt/java/jdk1.8.0_191/jre/bin/java '-Dcucumber.options=--tags \'not @ignored\''
2.22.4: /opt/java/jdk1.8.0_191/jre/bin/java '-Dcucumber.options=--tags \'not @ignored\''
You probably have to report this to surefire. The command line is valid.
I made it work for maven-surefire-plugin:2.22.1 using verbatim command from the 2.12.4 version. If anybody wonders, here's the solution:
<argLine>-Dcucumber.options="--tags '\''not @ignored'\''"</argLine>
I don't think it's possible to use newest maven-surefire-plugin with cucumber currently.
Perhaps we should also consider making tags work without explict @ symbols and/or qoutes. Not sure which symbol is the problem.
We can't disambiguate between --tags not @it and --tags not @it path/to/features. So that's already not possible.
@Mike-Now at version 2.22.2 and up this will work:
<argLine>-Dcucumber.options='--tags "not @ignored"'</argLine>
Looks like this fixed properly in maven-shared-utils/33659 but hasn't made it into the latest Surefire yet. It will be a matter of patience.
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.
Most helpful comment
Looks like this fixed properly in maven-shared-utils/33659 but hasn't made it into the latest Surefire yet. It will be a matter of patience.