Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JUnit Platform Engine] Improve Maven and Gradle compatibility #2832

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Dec 13, 2023

🤔 What's changed?

Maven Surefire and Gradle do not (yet?) fully support the JUnit Platform API[1]. To work around this problem the cucumber.features can be used.

However, because Maven Surefire and Gradle only attempt to discover class based tests, they do expect a class source. As a result of this missing source, Maven Surefire will not report on the executed tests while Gradle reports the tests as having been executed by an "Unknown Class".

By having the Cucumber TestEngine pretend to have a ClassSource when cucumber.features is used both these problems go away.

  1. [JUnit Platform] Support cucumber.features property #2498

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2c9a7cc) 84.97% compared to head (b1b863a) 84.99%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2832      +/-   ##
============================================
+ Coverage     84.97%   84.99%   +0.01%     
- Complexity     2728     2732       +4     
============================================
  Files           331      331              
  Lines          9545     9554       +9     
  Branches        917      918       +1     
============================================
+ Hits           8111     8120       +9     
  Misses         1109     1109              
  Partials        325      325              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mpkorstanje mpkorstanje force-pushed the junit-platform-use-test-engine-class-source branch from c7891c0 to dc77290 Compare December 13, 2023 00:32
Maven Surefire and Gradle do not (yet?) fully support the JUnit
Platform API[1]. To work around this problem the `cucumber.features`
can be used.

However, because Maven Surefire and Gradle only attempt to discover
class based tests, they do expect a class source. As a result of this
missing source, Maven Surefire will not report on the executed tests
while Gradle reports the tests as having been executed by an
"Unknown Class".

By having the Cucumber TestEngine pretend to have a ClassSource when
`cucumber.features` is used both these problems go away.

1. #2498
@mpkorstanje mpkorstanje force-pushed the junit-platform-use-test-engine-class-source branch from dc77290 to 5c5a19c Compare December 13, 2023 00:37
@mpkorstanje mpkorstanje marked this pull request as ready for review December 13, 2023 09:20
Copy link
Member

@mlvandijk mlvandijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestions on the text.

mpkorstanje and others added 2 commits December 13, 2023 11:39
…/platform/engine/Constants.java

Co-authored-by: Marit van Dijk <[email protected]>
@mpkorstanje mpkorstanje merged commit 65ef0eb into main Dec 14, 2023
7 checks passed
@mpkorstanje mpkorstanje deleted the junit-platform-use-test-engine-class-source branch December 14, 2023 20:57
@mpkorstanje
Copy link
Contributor Author

Thanks Marit!

mpkorstanje added a commit to cucumber/cucumber-java-skeleton that referenced this pull request Apr 15, 2024
With cucumber/cucumber-jvm#2832 there 
is no need for the pretty plugin anymore. The cucumber engine
will pretend to be a class and Maven can then report on it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants