Bin
Bin

Reputation: 119

Why the latest cucumber+serenity runs testcases filtered by tags so slowly?

I updated the serenity, cucumber, and JUnit to latest version. The serenity, cucumber version info:

    <serenity.version>4.1.20</serenity.version>
    <serenity.maven.version>4.1.20</serenity.maven.version>
    <serenity.cucumber.version>4.1.20</serenity.cucumber.version>
    <selenium.version>4.21.0</selenium.version>

The JUnit dependency:

<dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-suite</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit-platform-engine</artifactId>
        <version>7.18.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-suite</artifactId>
        <version>1.11.0-M2</version>
        <scope>test</scope>
    </dependency>

Here is the "junit-platform.properties"

cucumber.execution.parallel.enabled=true
cucumber.execution.parallel.config.strategy=fixed
cucumber.execution.parallel.config.fixed.parallelism=3
cucumber.execution.parallel.config.fixed.max-pool-size=3
cucumber.plugin=io.cucumber.core.plugin.SerenityReporterParallel,pretty
cucumber.execution.execution-mode.feature=same_thread

If I filter my test cases with 'cucumber.features', it works normally. The test will start within 1 minute.

My cmd is:

mvn clean verify -Dwebdriver.base.url=https://app.testsite.com -Dcucumber.features="src/test/resources/features/P2"

But if I filter the test cases by tags, it will hang for about 1 hour with these logs:

[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
Jun 17, 2024 10:51:02 PM io.cucumber.junit.platform.engine.DiscoverySelectorResolver    warnWhenCucumberFeaturesPropertyIsUsed
WARNING: Discovering tests using the cucumber.features property. Other discovery selectors are ignored!

This is a work around for the limited JUnit 5 support in Maven and Gradle. Please request/upvote/sponsor/ect better support for JUnit 5 discovery selectors. For details see: https://github.com/cucumber/cucumber-jvm/pull/2498

If you are using the JUnit 5 Suite Engine, Platform Launcher API or Console Launcher you should not use this property. Please consult the JUnit 5 documentation on test selection.

My cmd for tags is:

mvn clean verify -Dwebdriver.base.url=https://app.testsite.com -Dcucumber.filter.tags="@Tag1" -Dcucumber.features="src/test/resources/features/Regression"

I have about 5000 test cases in the "src/test/resources/features/Regression" and about 130 cases has the tag "@Tag1"

Upvotes: 0

Views: 106

Answers (0)

Related Questions