Skip to content

Add cucumber.junit-platform.discovery.as-root-engine #3023

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

Merged
merged 9 commits into from
Jul 13, 2025

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Jul 10, 2025

⚡️ What's your motivation?

The SBT JUpiter Interface assumes that all tests are classes but does discovery on the classpath root. As a result, it turns feature names into class selectors. Which doesn't quite work.

Setting cucumber.junit-platform.discovery.as-root-engine to false in junit-platform.properties should ensure Cucumber only discovers tests when called by another engine (e.g. the JUnit Platform Suite Engine) and by pass this behaviour.

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

Does this work?

📋 Checklist:

  • Extract constant, document constant.
  • Add workaround to README
  • 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.

The SBT JUpiter Interface assumes that all tests are classes[1] but
does discovery on the classpath root. As a result, it turns feature
names into class selectors. Which doesn't quite work.

Setting `cucumber.junit-platform.discover-as-root-engine=false` should
ensure Cucumber only discovers tests when called by another engine (e.g.
the JUnit Platform Suite Engine) and by pass this behaviour.

sbt/sbt-jupiter-interface#142
@mpkorstanje mpkorstanje changed the title Workaround for discovery with SBT Add cucumber.junit-platform.discovery.as-root-engine Jul 13, 2025
@mpkorstanje mpkorstanje marked this pull request as ready for review July 13, 2025 13:00
@mpkorstanje mpkorstanje merged commit 68e9256 into main Jul 13, 2025
6 checks passed
@mpkorstanje mpkorstanje deleted the workaround-sbt-issues branch July 13, 2025 13:10
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.

1 participant