trivago/cucable-plugin

Compile error - Runner class names don't match their file names

AdamPike opened this issue · 3 comments

Describe the bug

I've found that this issue is only reproducible when there is more than 1 feature with the same name but with different casing. This isn't a problem for Cucumber though, only this plugin.

Running the Cucable plugin with default parallelizationMode = scenarios, the runner classes created with names based on the feature files have different casing than their file names causing compilations errors.

To Reproduce

Two features in separate folders under the same features directory 1 named HeroBanner.feature, the other names Herobanner.feature.

POM:

<plugin>
    <groupId>com.trivago.rta</groupId>
    <artifactId>cucable-plugin</artifactId>
    <version>1.5.3</version>
    <executions>
        <execution>
            <id>generate-test-resources</id>
            <phase>generate-test-resources</phase>
            <goals>
                <goal>parallel</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <sourceRunnerTemplateFile>src/main/java/uk/co/tui/cucable/CucableJavaTemplate.java
        </sourceRunnerTemplateFile>
        <sourceFeatures>resources/features</sourceFeatures>
        <generatedRunnerDirectory>${project.build.directory}/parallel/runners</generatedRunnerDirectory>
        <generatedFeatureDirectory>${project.build.directory}/parallel/features</generatedFeatureDirectory>
    </configuration>
</plugin>

Cucable Template

@RunWith(Cucumber.class)
@CucumberOptions(
       // format = {"pretty", "html:target/cucumber-html-report", "json:target/cucumber-json-report/cucumber-report.json"},
        features = {"target/parallel/features/[CUCABLE:FEATURE].feature"},
        plugin = {"json:target/cucumber-report/[CUCABLE:RUNNER].json", "pretty", "html:target/cucumber-html-report", "json:target/cucumber-json-report/cucumber-report.json"},
        strict = true,
//        glue = {"classpath:uk.co.tui.cdaf"}
        glue = {"uk.co.tui.cdaf.frontend.stepdefs"}
)

public class CucableJavaTemplate {
    // [CUCABLE:CUSTOM:comment]
}

Result

The generated runner is:

Classname: HeroBanner_scenario004_run001_IT
Filename: Herobanner_scenario004_run001_IT

Expected behavior

Runners generated with matching class and file names.

Thanks for reporting. This indeed sounds like a bug and I will address this in the next release.

The expected behavior cannot be matched in operating systems that don't support the same filenames with different cases (e.g. Windows, MacOS). What would you expect there?

Closed due to no reaction.