diff --git a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy index a83bfe98..de98c8fc 100644 --- a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy +++ b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy @@ -21,9 +21,11 @@ class BaseInitScriptTest extends Specification { static final TestGradleVersion GRADLE_3_X = new TestGradleVersion(GradleVersion.version('3.5.1'), 7, 9) static final TestGradleVersion GRADLE_4_X = new TestGradleVersion(GradleVersion.version('4.10.3'), 7, 10) + static final TestGradleVersion GRADLE_5_1 = new TestGradleVersion(GradleVersion.version('5.1.1'), 8, 12) static final TestGradleVersion GRADLE_5_X = new TestGradleVersion(GradleVersion.version('5.6.4'), 8, 12) static final TestGradleVersion GRADLE_6_NO_BUILD_SERVICE = new TestGradleVersion(GradleVersion.version('6.5.1'), 8, 14) static final TestGradleVersion GRADLE_6_X = new TestGradleVersion(GradleVersion.version('6.9.4'), 8, 15) + static final TestGradleVersion GRADLE_7_0 = new TestGradleVersion(GradleVersion.version('7.0.1'), 8, 19) static final TestGradleVersion GRADLE_7_X = new TestGradleVersion(GradleVersion.version('7.6.2'), 8, 19) static final TestGradleVersion GRADLE_8_0 = new TestGradleVersion(GradleVersion.version('8.0.2'), 8, 19) static final TestGradleVersion GRADLE_8_X = new TestGradleVersion(GradleVersion.version('8.5'), 8, 19) diff --git a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy index e823b84e..18091e76 100644 --- a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy +++ b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy @@ -5,7 +5,7 @@ import static org.junit.Assume.assumeTrue class TestDependencyGraph extends BaseInitScriptTest { def initScript = 'gradle-build-action.github-dependency-graph.init.gradle' - static final List NO_DEPENDENCY_GRAPH_VERSIONS = [GRADLE_3_X, GRADLE_4_X] + static final List NO_DEPENDENCY_GRAPH_VERSIONS = [GRADLE_3_X, GRADLE_4_X, GRADLE_5_1, GRADLE_7_0] static final List DEPENDENCY_GRAPH_VERSIONS = ALL_VERSIONS - NO_DEPENDENCY_GRAPH_VERSIONS def "does not produce dependency graph when not enabled"() { @@ -48,15 +48,15 @@ class TestDependencyGraph extends BaseInitScriptTest { testGradleVersion << [GRADLE_8_X] } - def "warns and produces no dependency graph when enabled for older Gradle versions"() { + def "fails build when enabled for older Gradle versions"() { assumeTrue testGradleVersion.compatibleWithCurrentJvm when: - def result = run(['help'], initScript, testGradleVersion.gradleVersion, [], envVars) + def result = runAndFail(['help'], initScript, testGradleVersion.gradleVersion, [], envVars) then: assert !reportsDir.exists() - assert result.output.contains("::warning::Dependency Graph is not supported") + assert result.output.contains("GitHubDependencyGraphPlugin is not supported for ${testGradleVersion}") where: testGradleVersion << NO_DEPENDENCY_GRAPH_VERSIONS