Repository navigation
Conversation
…latforms Parent walks used TestIdentifier.getParentIdObject(), which is absent before JUnit Platform 1.8. When that method is missing, Cucumber scenarios keep feature display names as source and report Tests run: 0. Use TestPlan.getParent (API since 1.0) instead.
Contributor
|
@olamy can you take a look at this? We are facing an issue on 3.5.6 which this PR resolves. |
Member
|
Thanks for the PR. |
The existing cucumber IT stays on Platform 1.13, so it cannot show Tests run: 0 from the getParentIdObject gate. This fixture uses cucumber-junit + vintage 5.7.2 + platform 1.7.2.
Contributor
Author
|
yep, current cucumber IT is on 5.13 so it never hits this. added CucumberJUnit4VintageIT on vintage + platform 1.7.2, that's the Tests run: 0 path. pushed |
Contributor
|
This will be on 3.5.7 right? @olamy |
Member
this will be merged to |
2 of 6 tasks
olamy
pushed a commit
that referenced
this pull request
Aug 14, 2026
…r pre-1.8 platforms (#3429) (#3431) Backport of #3429 (909444c) from master, adapted for 3.5.x. Parent walks used TestIdentifier.getParentIdObject(), which is absent before JUnit Platform 1.8. When that method is missing, Cucumber scenarios keep feature display names as source and report Tests run: 0. Use TestPlan.getParent (API since 1.0) instead. Adapted for 3.5.x: - 3.5.x has no Suite-boundary handling in findTopParent (that landed on master after 3.5.x branched), so only the parent-resolution change is taken and the surrounding logic is left as-is. - Only the new notifiedWithRunnerClassWhenCucumberScenarioHasNoClassSource unit test is backported; the two Suite-hierarchy tests it sits next to on master do not exist here. - CucumberJUnit4VintageIT uses JUnit 4 annotations, matching the rest of surefire-its on this branch. The new IT covers the regression: the existing cucumber IT stays on Platform 1.13, so it cannot show Tests run: 0 from the getParentIdObject gate. This fixture uses cucumber-junit + vintage 5.7.2 + platform 1.7.2. Co-authored-by: Burak Kalaycı <kalayciburak1996@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cucumber scenarios can still report
Tests run: 0when the JUnit Platform on the test classpath is older than 1.8.RunListenerAdapterwalked parents throughTestIdentifier.getParentIdObject(), which only exists from Platform 1.8. On older launchers the walk no-ops, scenarios keep the feature display name assourceName, andTestSetRunListenerflushes an empty stats bucket for the runner class.This switches parent resolution to
TestPlan.getParent(TestIdentifier), available since Platform 1.0, for bothfindTopParentandfindFirstParentContainerAndSourceClass.Fixes #3428
Test plan
mvn -pl surefire-providers/surefire-junit-platform test -Dtest=RunListenerAdapterTest- 28/28 GREEN (includes newnotifiedWithRunnerClassWhenCucumberScenarioHasNoClassSource)mvn -pl surefire-providers/surefire-junit-platform test- 84/84 GREENmvn -pl surefire-its -Prun-its -Dit.test=CucumberJUnit4VintageIT verify- GREEN (cucumber-junit + vintage 5.7.2 + platform 1.7.2)