@@ -40,7 +40,8 @@ void before() throws IOException {
4040 @ CartesianValueSource (strings = {"test-project" , "test-project-kotlin" , "test-project-groovy" })
4141 @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" , "6.8.3" , "7.0" , "7.1" , "7.2" })
4242 void smokeTest (String projectName , String gradleVersion ) {
43- LOGGER .info ("Executing smokeTest with Gradle {}" , gradleVersion );
43+ LOGGER .lifecycle ("Executing smokeTest of {} with Gradle {}" , projectName , gradleVersion );
44+ if (!checkCombination (projectName , gradleVersion )) return ;
4445 var result = GradleRunner .create ()
4546 .withProjectDir (new File (projectName + "/" ))
4647 .withPluginClasspath (pluginClasspath )
@@ -60,10 +61,10 @@ void smokeTest(String projectName, String gradleVersion) {
6061
6162 @ CartesianProductTest (name = "smokeTestRun({arguments})" )
6263 @ CartesianValueSource (strings = {"test-project" , "test-project-kotlin" , "test-project-groovy" })
63- // Fails with Gradle versions >= 6.6. See https://github.com/java9-modularity/gradle-modules-plugin/issues/165
64- @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" /*, "6.8.3", "7.0"*/ })
64+ @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" , "6.8.3" , "7.0" , "7.2" })
6565 void smokeTestRun (String projectName , String gradleVersion ) {
66- LOGGER .info ("Executing smokeTestRun with Gradle {}" , gradleVersion );
66+ LOGGER .lifecycle ("Executing smokeTestRun of {} with Gradle {}" , projectName , gradleVersion );
67+ if (!checkCombination (projectName , gradleVersion )) return ;
6768 var writer = new StringWriter (256 );
6869 var result = GradleRunner .create ()
6970 .withProjectDir (new File (projectName + "/" ))
@@ -87,7 +88,7 @@ void smokeTestRun(String projectName, String gradleVersion) {
8788 @ CartesianValueSource (strings = {"5.4.2/1.4.2" , "5.5.2/1.5.2" , "5.7.1/1.7.1" })
8889 @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" , "6.8.3" , "7.0" })
8990 void smokeTestJunit5 (String junitVersionPair , String gradleVersion ) {
90- LOGGER .info ("Executing smokeTestJunit5 with Gradle {}" , gradleVersion );
91+ LOGGER .lifecycle ("Executing smokeTestJunit5 with junitVersionPair {} and Gradle {}" , junitVersionPair , gradleVersion );
9192 var junitVersionParts = junitVersionPair .split ("/" );
9293 var junitVersionProperty = String .format ("-PjUnitVersion=%s" , junitVersionParts [0 ]);
9394 var junitPlatformVersionProperty = String .format ("-PjUnitPlatformVersion=%s" , junitVersionParts [1 ]);
@@ -109,7 +110,7 @@ void smokeTestJunit5(String junitVersionPair, String gradleVersion) {
109110 // It currently fails with Gradle 7.0
110111 @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" , "6.8.3" /*, "7.0"*/ })
111112 void smokeTestMixed (String gradleVersion ) {
112- LOGGER .info ("Executing smokeTestMixed with Gradle {}" , gradleVersion );
113+ LOGGER .lifecycle ("Executing smokeTestMixed with Gradle {}" , gradleVersion );
113114 var result = GradleRunner .create ()
114115 .withProjectDir (new File ("test-project-mixed" ))
115116 .withPluginClasspath (pluginClasspath )
@@ -159,9 +160,10 @@ private static void assertExpectedClassFileFormats(
159160
160161 @ CartesianProductTest (name = "smokeTestDist({arguments})" )
161162 @ CartesianValueSource (strings = {"test-project" , "test-project-kotlin" , "test-project-groovy" })
162- @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" , "6.8.3" , "7.0" })
163+ @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" , "6.8.3" , "7.0" , "7.2" })
163164 void smokeTestDist (String projectName , String gradleVersion ) {
164- LOGGER .info ("Executing smokeTestDist with Gradle {}" , gradleVersion );
165+ LOGGER .lifecycle ("Executing smokeTestDist of {} with Gradle {}" , projectName , gradleVersion );
166+ if (!checkCombination (projectName , gradleVersion )) return ;
165167 var result = GradleRunner .create ()
166168 .withProjectDir (new File (projectName + "/" ))
167169 .withPluginClasspath (pluginClasspath )
@@ -201,7 +203,8 @@ void smokeTestDist(String projectName, String gradleVersion) {
201203 @ CartesianValueSource (strings = {"test-project" , "test-project-kotlin" , "test-project-groovy" })
202204 @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" , "6.8.3" , "7.0" , "7.2" })
203205 void smokeTestRunDemo (String projectName , String gradleVersion ) {
204- LOGGER .info ("Executing smokeTestRunDemo with Gradle {}" , gradleVersion );
206+ LOGGER .lifecycle ("Executing smokeTestRunDemo of {} with Gradle {}" , projectName , gradleVersion );
207+ if (!checkCombination (projectName , gradleVersion )) return ;
205208 var result = GradleRunner .create ()
206209 .withProjectDir (new File (projectName + "/" ))
207210 .withPluginClasspath (pluginClasspath )
@@ -217,10 +220,11 @@ void smokeTestRunDemo(String projectName, String gradleVersion) {
217220
218221 @ CartesianProductTest (name = "smokeTestRunStartScripts({arguments})" )
219222 @ CartesianValueSource (strings = {"test-project" , "test-project-kotlin" , "test-project-groovy" })
220- // Fails with Gradle versions >= 6.6. See https://github.com/java9-modularity/gradle-modules-plugin/issues/165
221- @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" /*, "6.8.3", "7.0"*/ })
223+ // Fails with Gradle versions >= 6.6.
224+ @ CartesianValueSource (strings = {"5.1" , "5.6" , "6.3" , "6.4.1" , "6.5.1" /*, "6.8.3", "7.0", "7.2" */ })
222225 void smokeTestRunStartScripts (String projectName , String gradleVersion ) {
223- LOGGER .info ("Executing smokeTestRunScripts with Gradle {}" , gradleVersion );
226+ LOGGER .lifecycle ("Executing smokeTestRunScripts of {} with Gradle {}" , projectName , gradleVersion );
227+ if (!checkCombination (projectName , gradleVersion )) return ;
224228 var result = GradleRunner .create ()
225229 .withProjectDir (new File (projectName + "/" ))
226230 .withPluginClasspath (pluginClasspath )
@@ -245,4 +249,11 @@ private static void assertTasksSuccessful(BuildResult result, String subprojectN
245249 }
246250 }
247251
252+ private static boolean checkCombination (String projectName , String gradleVersion ) {
253+ if (projectName .equals ("test-project-kotlin" ) && gradleVersion .compareTo ("6.4" ) < 0 ) {
254+ LOGGER .lifecycle ("Unsupported combination: {} / Gradle {}. Test skipped" , projectName , gradleVersion );
255+ return false ;
256+ }
257+ return true ;
258+ }
248259}
0 commit comments