Commit aa63070f authored by Scott Frederick's avatar Scott Frederick

Apply test conventions unconditionally

See gh-21272
parent 8ec16bd0
...@@ -107,18 +107,19 @@ class JavaConventions { ...@@ -107,18 +107,19 @@ class JavaConventions {
} }
private void configureTestConventions(Project project) { private void configureTestConventions(Project project) {
if (Boolean.valueOf(System.getenv("CI"))) { project.getTasks().withType(Test.class, (test) -> {
withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java"));
test.useJUnitPlatform();
test.setMaxHeapSize("1024M");
});
if (Boolean.parseBoolean(System.getenv("CI"))) {
project.getPlugins().apply(TestRetryPlugin.class); project.getPlugins().apply(TestRetryPlugin.class);
project.getTasks().withType(Test.class, (test) -> { project.getTasks().withType(Test.class,
withOptionalBuildJavaHome(project, (javaHome) -> test.setExecutable(javaHome + "/bin/java")); (test) -> project.getPlugins().withType(TestRetryPlugin.class, (testRetryPlugin) -> {
test.useJUnitPlatform(); TestRetryTaskExtension testRetry = test.getExtensions().getByType(TestRetryTaskExtension.class);
test.setMaxHeapSize("1024M"); testRetry.getFailOnPassedAfterRetry().set(true);
project.getPlugins().withType(TestRetryPlugin.class, (testRetryPlugin) -> { testRetry.getMaxRetries().set(3);
TestRetryTaskExtension testRetry = test.getExtensions().getByType(TestRetryTaskExtension.class); }));
testRetry.getFailOnPassedAfterRetry().set(true);
testRetry.getMaxRetries().set(3);
});
});
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment