Skip to content

Introduce @Disabled annotation to disable a @Suite #4797

@mpkorstanje

Description

@mpkorstanje

With JUnit 4 it was possible to ignore a suite. For example:

package io.cucumber.examples.calculator;

...

@Ignore
@RunWith(Cucumber.class)
public class RunCucumberTest {

}

This allowed people to disable a specific execution when running all tests and still have ability to run it manually from their IDE (ignoring the annotation).

With JUnit 5 people then imagine the equivalent would be

package io.cucumber.examples.calculator;

...

@Disabled
@Suite
@IncludeEngines("cucumber")
@SelectPackages("io.cucumber.examples.calculator")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.examples.calculator")
public class RunCucumberTest {
}

And then expect org.junit.jupiter.api.Disabled to work. Which naturally doesn't work because ExecutionCondition is a JUpiter extension, which do not apply to Suite engines.

Originally reported as cucumber/cucumber-jvm#3033 and as indicated there this feature request is not urgent. I think we can let this sit to gauge interest.

Deliverables

  • Add org.junit.platform.suite.api.Disabled and implement in the Suite Engine.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions