diff --git a/src/test/groovy/com/gradle/BaseInitScriptTest.groovy b/src/test/groovy/com/gradle/BaseInitScriptTest.groovy index ca6839c..38132e1 100644 --- a/src/test/groovy/com/gradle/BaseInitScriptTest.groovy +++ b/src/test/groovy/com/gradle/BaseInitScriptTest.groovy @@ -51,11 +51,10 @@ abstract class BaseInitScriptTest extends Specification { dvPlugin(GRADLE_ENTERPRISE, DEVELOCITY_PLUGIN_VERSION, true), dvPlugin(GRADLE_ENTERPRISE, '3.17', true), - dvPlugin(GRADLE_ENTERPRISE, '3.16.2'), - dvPlugin(GRADLE_ENTERPRISE, '3.6.4'), - dvPlugin(GRADLE_ENTERPRISE, '3.3.4'), // Has background build-scan upload - dvPlugin(GRADLE_ENTERPRISE, '3.2.1'), // Has 'gradleEnterprise.server' element - dvPlugin(GRADLE_ENTERPRISE, '3.1.1'), // Has 'gradleEnterprise.buildScan.server' value + dvPlugin(GRADLE_ENTERPRISE, '3.16.2'), // Last version before DV + dvPlugin(GRADLE_ENTERPRISE, '3.11.1'), // Oldest version compatible with CCUD 2.0.2 + dvPlugin(GRADLE_ENTERPRISE, '3.3.4'), // Introduced background build-scan upload + dvPlugin(GRADLE_ENTERPRISE, '3.2.1'), // Introduced 'gradleEnterprise.server' element dvPlugin(GRADLE_ENTERPRISE, '3.0'), // Earliest version of `com.gradle.enterprise` plugin dvPlugin(BUILD_SCAN, DEVELOCITY_PLUGIN_VERSION, true), @@ -397,8 +396,17 @@ abstract class BaseInitScriptTest extends Specification { } String getCompatibleCCUDVersion() { - // CCUD 1.13 is compatible with pre-develocity plugins - return pluginVersionAtLeast('3.17') ? CCUD_PLUGIN_VERSION : '1.13' + if (pluginVersionAtLeast('3.11')) { + return CCUD_PLUGIN_VERSION + } + if (pluginVersionAtLeast('3.2')) { + return '1.13' + } + if (pluginId == BUILD_SCAN && version == '1.16') { + return '1.13' + } + // No known compatible CCUD for older plugin versions + return null } private boolean pluginVersionAtLeast(String targetVersion) { diff --git a/src/test/groovy/com/gradle/TestDevelocityInjection.groovy b/src/test/groovy/com/gradle/TestDevelocityInjection.groovy index 2d0efbf..9d0f98a 100644 --- a/src/test/groovy/com/gradle/TestDevelocityInjection.groovy +++ b/src/test/groovy/com/gradle/TestDevelocityInjection.groovy @@ -90,6 +90,8 @@ class TestDevelocityInjection extends BaseInitScriptTest { where: [testGradle, testDvPlugin] << getVersionsToTestForExistingDvPlugin(CCUD_COMPATIBLE_GRADLE_VERSIONS) + // Ignore test for old versions of plugin where no CCUD works. + .findAll {testGradle, testDvPlugin -> testDvPlugin.compatibleCCUDVersion != null} } @Requires({data.testGradle.compatibleWithCurrentJvm}) @@ -109,6 +111,8 @@ class TestDevelocityInjection extends BaseInitScriptTest { where: [testGradle, testDvPlugin] << getVersionsToTestForExistingDvPlugin(CCUD_COMPATIBLE_GRADLE_VERSIONS) + // Ignore test for old versions of plugin where no CCUD works. + .findAll {testGradle, testDvPlugin -> testDvPlugin.compatibleCCUDVersion != null} } @Requires({data.testGradle.compatibleWithCurrentJvm}) @@ -192,6 +196,8 @@ class TestDevelocityInjection extends BaseInitScriptTest { where: [testGradle, testDvPlugin] << getVersionsToTestForExistingDvPlugin() + // TODO: There is a bug in the init-script, trying to set `gradleEnterprise.server` does not work for GE plugin `v3.0` + .findAll {testGradle, testDvPlugin -> !(testDvPlugin.pluginId.id == 'com.gradle.enterprise' && testDvPlugin.version == '3.0')} } @Requires({data.testGradle.compatibleWithCurrentJvm})