trivago/cucable-plugin

Report parallel Features in a single Reportfile

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.
When Running Features in parrallel mode while using the cucumber json-Plugin I endup with a json file for every feature file.
My Runner configuration looks something like this:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = {"target/parallel/features/[CUCABLE:FEATURE].feature"},
        glue = {"de.db.vendo.journeytests.steps"},
        plugin = {"json:target/cucumber-report/[CUCABLE:RUNNER].json"},
        strict = true,
        tags = {"not @Ignore"}
)

This is fine and works as expected.

But in my case I need to have a single Reportfile that contains all the run features.
currently I merge the report files into one using a shellscript.

Describe the solution you'd like
My Expectation would be, by configuring the Runner something like this:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = {"target/parallel/features/[CUCABLE:FEATURE].feature"},
        glue = {"de.db.vendo.journeytests.steps"},
        plugin = {"json:target/cucumber-report/Cucumber-Report.json"},
        strict = true,
        tags = {"not @Ignore"}
)

I would get one large report file.

infact I get a single Reportfile, but the contained json is broken. I suspect that multiple process write into the file at once which leads to broken data.

I know, that since the report is generated by the json-plugin, it most likely will need somekind of postprocessing step to merge the report.
My hope is that cucuble is able to do that post processing for me and I don't need to use my own shellscript for that.

Hi! Your configuration creates a separate json file due to your configuration:
plugin = {"json:target/cucumber-report/[CUCABLE:RUNNER].json"},
Here you say that Cucable should configure Cucumber to take the runner name as the name of the json file.

So you could try to do this (however, you might run into concurrency problems when writing to one file by multiple threads):
plugin = {"json:target/cucumber-report/a_single_json_file.json"},

Or you can use a separate reporting library such as Cluecumber which automatically merges the json files into a single report.

Cucable runs before the test runs so it cannot alter json files that are generated during test runs.

ok, exactly like I expected, thanks anyway :-)