From 331ce268c13a6870efaf403ececd3fabc26faaee Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 17 Sep 2024 09:31:26 +0100 Subject: [PATCH] Align Gradle test version with minimum supported version Closes gh-97 --- ...cityConventionsPluginIntegrationTests.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/develocity-conventions-gradle-plugin/src/test/java/io/spring/develocity/conventions/gradle/DevelocityConventionsPluginIntegrationTests.java b/develocity-conventions-gradle-plugin/src/test/java/io/spring/develocity/conventions/gradle/DevelocityConventionsPluginIntegrationTests.java index db39a92..bbd86f9 100644 --- a/develocity-conventions-gradle-plugin/src/test/java/io/spring/develocity/conventions/gradle/DevelocityConventionsPluginIntegrationTests.java +++ b/develocity-conventions-gradle-plugin/src/test/java/io/spring/develocity/conventions/gradle/DevelocityConventionsPluginIntegrationTests.java @@ -47,7 +47,7 @@ class DevelocityConventionsPluginIntegrationTests { @Test void whenThePluginIsAppliedThenBuildScanConventionsAreApplied(@TempDir File projectDir) { prepareProject(projectDir); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildScanConfig"); + BuildResult result = build(projectDir, "verifyBuildScanConfig"); assertThat(result.getOutput()).contains("Build scan server: https://ge.spring.io"); assertThat(result.getOutput()).contains("Capture task input files: true"); } @@ -55,14 +55,14 @@ void whenThePluginIsAppliedThenBuildScanConventionsAreApplied(@TempDir File proj @Test void whenThePluginIsAppliedThenBuildCacheConventionsAreApplied(@TempDir File projectDir) { prepareProject(projectDir); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildCacheConfig"); + BuildResult result = build(projectDir, "verifyBuildCacheConfig"); assertThat(result.getOutput()).contains("Build cache server: https://ge.spring.io"); } @Test void whenThePluginIsAppliedAndBuildScansAreDisabledThenBuildScanConventionsAreNotApplied(@TempDir File projectDir) { prepareProject(projectDir); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildScanConfig", "--no-scan"); + BuildResult result = build(projectDir, "verifyBuildScanConfig", "--no-scan"); assertThat(result.getOutput()).contains("Build scan server: null"); assertThat(result.getOutput()).contains("Capture task input files: false"); } @@ -72,7 +72,7 @@ void whenThePluginIsAppliedAndTheSpringBuildTypeIsNotOssThenBuildScanConventions @TempDir File projectDir) { prepareProject(projectDir); write(new File(projectDir, "gradle.properties"), (writer) -> writer.println("spring.build-type=other")); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildScanConfig"); + BuildResult result = build(projectDir, "verifyBuildScanConfig"); assertThat(result.getOutput()).contains("Build scan server: null"); assertThat(result.getOutput()).contains("Capture task input files: false"); } @@ -81,7 +81,7 @@ void whenThePluginIsAppliedAndTheSpringBuildTypeIsNotOssThenBuildScanConventions void whenThePluginIsAppliedAndTheSpringBuildTypeIsOssThenBuildScanConventionsAreApplied(@TempDir File projectDir) { prepareProject(projectDir); write(new File(projectDir, "gradle.properties"), (writer) -> writer.println("spring.build-type=oss")); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildScanConfig"); + BuildResult result = build(projectDir, "verifyBuildScanConfig"); assertThat(result.getOutput()).contains("Build scan server: https://ge.spring.io"); assertThat(result.getOutput()).contains("Capture task input files: true"); } @@ -90,7 +90,7 @@ void whenThePluginIsAppliedAndTheSpringBuildTypeIsOssThenBuildScanConventionsAre void whenThePluginIsAppliedAndPropertiesTaskIsExecutedThenBuildScanConventionsAreNotApplied( @TempDir File projectDir) { prepareProject(projectDir); - BuildResult result = build(projectDir, "6.0.1", "properties", "verifyBuildScanConfig", "--no-scan"); + BuildResult result = build(projectDir, "properties", "verifyBuildScanConfig", "--no-scan"); assertThat(result.getOutput()).contains("Build scan server: null"); assertThat(result.getOutput()).contains("Capture task input files: false"); } @@ -99,7 +99,7 @@ void whenThePluginIsAppliedAndPropertiesTaskIsExecutedThenBuildScanConventionsAr void givenMultiProjectBuildWhenThePluginIsAppliedAndPropertiesTaskIsExecutedThenBuildScanConventionsAreNotApplied( @TempDir File projectDir) { prepareMultiModuleProject(projectDir); - BuildResult result = build(projectDir, "6.0.1", "sub:properties", "sub:verifyBuildScanConfig", "--no-scan"); + BuildResult result = build(projectDir, "sub:properties", "sub:verifyBuildScanConfig", "--no-scan"); assertThat(result.getOutput()).contains("Build scan server: null"); assertThat(result.getOutput()).contains("Capture task input files: false"); } @@ -107,7 +107,7 @@ void givenMultiProjectBuildWhenThePluginIsAppliedAndPropertiesTaskIsExecutedThen @Test void whenThePluginIsAppliedAndScanIsSpecifiedThenServerIsNotCustomized(@TempDir File projectDir) { prepareProject(projectDir); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildScanConfig", "--scan"); + BuildResult result = build(projectDir, "verifyBuildScanConfig", "--scan"); assertThat(result.getOutput()).contains("Build scan server: null"); assertThat(result.getOutput()).contains("Capture task input files: true"); } @@ -115,7 +115,7 @@ void whenThePluginIsAppliedAndScanIsSpecifiedThenServerIsNotCustomized(@TempDir @Test void whenThePluginIsAppliedAndBuildCacheIsDisabledThenBuildCacheConventionsAreNotApplied(@TempDir File projectDir) { prepareProject(projectDir); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildCacheConfig", "--no-build-cache"); + BuildResult result = build(projectDir, "verifyBuildCacheConfig", "--no-build-cache"); assertThat(result.getOutput()).contains("Build cache server: null"); } @@ -124,7 +124,7 @@ void whenThePluginIsAppliedAndTheSpringBuildTypeIsNotOssThenBuildCacheConvention @TempDir File projectDir) { prepareProject(projectDir); write(new File(projectDir, "gradle.properties"), (writer) -> writer.println("spring.build-type=other")); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildCacheConfig"); + BuildResult result = build(projectDir, "verifyBuildCacheConfig"); assertThat(result.getOutput()).contains("Build cache server: null"); } @@ -132,7 +132,7 @@ void whenThePluginIsAppliedAndTheSpringBuildTypeIsNotOssThenBuildCacheConvention void whenThePluginIsAppliedAndTheSpringBuildTypeIsOssThenBuildCacheConventionsAreApplied(@TempDir File projectDir) { prepareProject(projectDir); write(new File(projectDir, "gradle.properties"), (writer) -> writer.println("spring.build-type=oss")); - BuildResult result = build(projectDir, "6.0.1", "verifyBuildCacheConfig"); + BuildResult result = build(projectDir, "verifyBuildCacheConfig"); assertThat(result.getOutput()).contains("Build cache server: https://ge.spring.io"); } @@ -206,7 +206,7 @@ private String version() { } } - private BuildResult build(File projectDir, String gradleVersion, String... arguments) { + private BuildResult build(File projectDir, String... arguments) { List classpath = Arrays.asList(new File("bin/main"), new File("build/classes/java/main"), new File("build/resources/main"), new File(DevelocityPlugin.class.getProtectionDomain().getCodeSource().getLocation().getFile()), @@ -214,7 +214,6 @@ private BuildResult build(File projectDir, String gradleVersion, String... argum List augmentedArguments = new ArrayList<>(Arrays.asList(arguments)); augmentedArguments.add("--stacktrace"); return GradleRunner.create() - .withGradleVersion(gradleVersion) .withProjectDir(projectDir) .withPluginClasspath(classpath) .withArguments(augmentedArguments)