Skip to content

JUnit 5 @Disabled annotation is ignored #3033

@gaeljw

Description

@gaeljw

👓 What did you see?

We are in the process of moving away from cucumber-junit to cucumber-junit-platform-engine (JUnit 4 to 5).

I just realized that the JUnit 5 @Disabled annotation seem to have no effect on a Cucumber "runner class": the tests are still run.

I reproduced it on the examples project https://github.com/cucumber/cucumber-jvm/tree/main/examples/calculator-java-junit5:

  • adding org.junit.jupiter.api.Disabled annotation to RunCucumberTest (needed to add the org.junit.jupiter:junit-jupiter-api dependency in the POM)
  • changing a feature file so that there's one error and one scenario failing (easier to see)

✅ What did you expect to see?

I expect the scenarios to not be executed if the "runner class" is flagged as @Disabled

📦 Which tool/library version are you using?

Cucumber 7.26.0

🔬 How could we reproduce it?

I can provide a dedicated separate MRE if needed ;)

📚 Any additional context?

Am I missing something obvious related to JUnit 5 (I'm very new to it) or is this an issue in the cucumber engine?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions