Home > Back-end >  Karate - Results from two series of tests aren't merged anymore after upgrading version from 0.
Karate - Results from two series of tests aren't merged anymore after upgrading version from 0.

Time:07-06

We are facing an issue related to the tests results after upgrading our Karate project from V0.9.3 to V1.2.0. We are testing an API after the execution of two batchs. Therefore we have a first series of tests (Runner 1) executed on our API after our first batch run, then a second series of tests (Runner 2 on new features files) executed ofter our 2nd batch.

On the version we were using, the tests results were merged but on the updated version, we cannot achieve to get all the results on the same report : the results of the first run are deleted so we’re left with only the results of the second run.

Previously working code :

Results results1 = Runner.parallel(
                Arrays.asList("@tag1,@tag2", "@ignore"),
                Collections.singletonList("classpath:features"),
                5,
                "target/sources-rapports");

int totalFailCount = results1.getFailCount();

Results results2 = Runner.parallel(Arrays.asList("@tag3,@tag4", "@ignore"),Collections.singletonList("classpath:features"),5,"target/sources-rapports");

totalFailCount  = results2.getFailCount();

generateReport(results2.getReportDir());

The report would contain all test features of results1 and results2. Whereas now, each execution seems to remove previous karate json files before generating the new ones.

New non-working code with the following syntax :

Runner.path("classpath:features")
        .tags(Arrays.asList("@tag1,@tag2", "@ignore"))
        .outputCucumberJson(true)
        .parallel(5);

I'm looking for help to solve this problem. Do not hesitate to ask for more informations if you need.

CodePudding user response:

Try this change:

Runner.path("classpath:features")
    .tags(Arrays.asList("@tag1,@tag2", "@ignore"))
    .outputCucumberJson(true)
    .backupReportDir(false)
    .parallel(5);

For further info: https://stackoverflow.com/a/66685944/143475

  • Related