I am trying to update my project to the last karate release 0.9.5. All works fine except the parallel execution. It doesn't take in account the tags I run using the command line "-Dkarate.options".
This is my TestParallel java class:
public class QaaTestParallel {
@Test
public void testParallel() {
Results results = Runner.path("classpath:e2e").parallel(2);
generateReport(results.getReportDir());
assertTrue(results.getErrorMessages(), results.getFailCount() == 0);
}
public static void generateReport(String karateOutputPath) {
Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[] {"json"}, true);
List<String> jsonPaths = new ArrayList(jsonFiles.size());
jsonFiles.forEach(file -> jsonPaths.add(file.getAbsolutePath()));
Configuration config = new Configuration(new File("target"), "e2e Karate");
config.setNotFailingStatuses(Collections.singleton(Status.SKIPPED));
config.setSortingMethod(SortingMethod.ALPHABETICAL);
ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
reportBuilder.generateReports();
}
}
To run the tests I use the following command line instruction:
mvn clean test -Dkarate.options="--tags @smoke" -Dtest=QaaTestParallel
But it runs all my tests.
I tried different options but I didn't get to work. Can anyone give me a hand?
Thanks a lot.