apache / apache/maven-surefire
[SUREFIRE-1724] Support JUnit Platform DiscoverySelectors
- Dominant language
- Java
- Stars
- 461
- Forks
- 588
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 19
Description
**[M.P. Korstanje](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=mpkorstanje)** opened **[SUREFIRE-1724](https://issues.apache.org/jira/browse/SUREFIRE-1724?redirect=false)** and commented
The JUnit Platform defines multiple [DiscoverySelectors](https://junit.org/junit5/docs/5.0.2/api/org/junit/platform/engine/DiscoverySelector.html) to discover tests in different locations. This allows TestEngines to discover tests in classes, the class path root, resource root, files, ect.
Currently Surefire supports TestEngine implementations through the JUnitPlatformProvider. However the JUnitPlatformProvider only issues discovery requests for classes that have already been discovered by Surefire. Additionally if no tests were discovered by Surefire then no test discovery requests will be issued at all.
This means that Surefire does not fully utilize the discovery capabilities of the JUnit Platform and makes it impossible to use the JUnitPlatformProvider for test frameworks that do not have class based tests such as Cucumber.
To make Cucumber work at the very least the class path root discovery selector would have to be supported.
---
**Issue Links:**
- [SUREFIRE-1727](https://issues.apache.org/jira/browse/SUREFIRE-1727) Failures during test template creation are ignored
5 votes, 12 watchers
Contributor guide
Research direction
Start at the JUnitPlatformProvider and compare its current discovery requests with the JUnit Platform's DiscoverySelectors. Reproduce the case where Surefire discovers no tests, then verify that class-path-root discovery works for Cucumber or another non-class-based engine. Done means supported selectors issue discovery requests even when Surefire finds no classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100