@@ -107,18 +107,19 @@ private void configureJarManifestConventions(Project project) {
107107 }
108108
109109 private void configureTestConventions (Project project ) {
110- if (Boolean .valueOf (System .getenv ("CI" ))) {
110+ project .getTasks ().withType (Test .class , (test ) -> {
111+ withOptionalBuildJavaHome (project , (javaHome ) -> test .setExecutable (javaHome + "/bin/java" ));
112+ test .useJUnitPlatform ();
113+ test .setMaxHeapSize ("1024M" );
114+ });
115+ if (Boolean .parseBoolean (System .getenv ("CI" ))) {
111116 project .getPlugins ().apply (TestRetryPlugin .class );
112- project .getTasks ().withType (Test .class , (test ) -> {
113- withOptionalBuildJavaHome (project , (javaHome ) -> test .setExecutable (javaHome + "/bin/java" ));
114- test .useJUnitPlatform ();
115- test .setMaxHeapSize ("1024M" );
116- project .getPlugins ().withType (TestRetryPlugin .class , (testRetryPlugin ) -> {
117- TestRetryTaskExtension testRetry = test .getExtensions ().getByType (TestRetryTaskExtension .class );
118- testRetry .getFailOnPassedAfterRetry ().set (true );
119- testRetry .getMaxRetries ().set (3 );
120- });
121- });
117+ project .getTasks ().withType (Test .class ,
118+ (test ) -> project .getPlugins ().withType (TestRetryPlugin .class , (testRetryPlugin ) -> {
119+ TestRetryTaskExtension testRetry = test .getExtensions ().getByType (TestRetryTaskExtension .class );
120+ testRetry .getFailOnPassedAfterRetry ().set (true );
121+ testRetry .getMaxRetries ().set (3 );
122+ }));
122123 }
123124 }
124125
0 commit comments