我正在尝试将我的项目更新到最新的空手道版本 0.9.5。除了并行执行之外,一切正常。它没有考虑我使用命令行“-Dkarate.options”运行的标签。
这是我的 TestParallel java 类:
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();
}
}
为了运行测试,我使用以下命令行指令:
mvn clean test -Dkarate.options="--tags @smoke" -Dtest=QaaTestParallel
但它运行了我所有的测试。
我尝试了不同的选择,但我没有开始工作。有人可以帮我吗?
多谢。
是的,我们错过了这一点,这是一个错误。我已经修复了这个问题develop
分支。如果您可以在本地构建和测试它,这将对我们有很大帮助,这很简单:https://github.com/intuit/karate/issues/1061 https://github.com/intuit/karate/issues/1061
目前,使用旧的注释方式作为解决方法,或者创建一个新的运行程序,其中标签组合是“硬编码”的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)