No tests are discovered if feature starts with comments followed by description
See original GitHub issue👓 What did you see?
It seems that (at least) the junit-platform-suite fails to discover tests if any feature starts with a comment followed by a description
✅ What did you expect to see?
Tests should be discovered since syntax is correct
📦 Which tool/library version are you using?
Cucumber for java 7.8.1
🔬 How could we reproduce it?
Steps to reproduce the behavior:
- A feature which starts with a comment followed by a description
Feature: Feature 2
# some comment
some description
Scenario: Scenario 1
* Wait 3s
- Run feature, either from Maven or from the IDE. You may also try to execute the whole suite of tests containing this Feature. No test will be executed.
- See error from maven surefire plugin:
[ERROR] There was an error in the forked process
[ERROR] TestEngine with ID 'junit-platform-suite' failed to discover tests
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] TestEngine with ID 'junit-platform-suite' failed to discover tests
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:701)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:311)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:268)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1334)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1167)
You can reproduce this issue by building the following cucumber-showcase project: https://github.com/fslev/cucumber-showcase.git
mvn clean test
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
TestExplorer does not discover new tests in existing test class
Open solution with NUnit test classes builds fine. After the build process test explorer shows and runs all tests successfully. Test results are...
Read more >Python Unittest: No tests discovered in Visual Studio Code
The python Testing plugin won't find your tests if there is an error in the test script. To check for a potential error,...
Read more >How to resolve cases of Visual Studio “No tests appearing”
An upcoming blog post will detail a procedure for how to do this. One good tip here is to determine if it is...
Read more >doctest — Test interactive Python examples — Python 3.11.1 ...
This will import example.py as a standalone module and run testmod() on it. Note that this may not work correctly if the file...
Read more >Set up unit testing for Python code - Visual Studio
Setting up unit testing for Python code in Visual Studio takes full advantage of Test Explorer features to discover, run, and debug tests....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Gherkin has a grammar that explicitly includes comments and comments are not allowed before the description.
https://github.com/cucumber/common/blob/main/gherkin/gherkin.berp#L37
You may want to create an issue in https://github.com/cucumber/common to address that.
Yeah, that’s between JUnit 5 and Surefire. You could petition the JUnit 5 team to include more information in the
JUnitException
thrown when discovery fails.