Skip to content

Commit

Permalink
Do not use withPluginClasspath in tests
Browse files Browse the repository at this point in the history
See details here google#631
  • Loading branch information
rougsig committed Nov 6, 2022
1 parent 5cc9d89 commit 3196f30
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
23 changes: 10 additions & 13 deletions src/test/groovy/com/google/protobuf/gradle/IDESupportTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ package com.google.protobuf.gradle

import groovy.transform.CompileDynamic
import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.Specification
import spock.lang.Unroll
Expand All @@ -51,12 +50,11 @@ class IDESupportTest extends Specification {
.build()

when: "idea is invoked"
BuildResult result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments('idea')
.withPluginClasspath()
.withGradleVersion(gradleVersion)
.build()
BuildResult result = ProtobufPluginTestHelper.getGradleRunner(
projectDir,
gradleVersion,
"idea"
).build()

then: "it succeed"
result.task(":idea").outcome == TaskOutcome.SUCCESS
Expand Down Expand Up @@ -130,12 +128,11 @@ class IDESupportTest extends Specification {
.build()

when: "eclipse is invoked"
BuildResult result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments('eclipse')
.withPluginClasspath()
.withGradleVersion(gradleVersion)
.build()
BuildResult result = ProtobufPluginTestHelper.getGradleRunner(
projectDir,
gradleVersion,
"eclipse"
).build()

then: "it succeed"
result.task(":eclipse").outcome == TaskOutcome.SUCCESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.google.protobuf.gradle

import groovy.transform.CompileDynamic
import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.Specification
import spock.lang.Unroll
Expand All @@ -23,17 +22,11 @@ class ProtobufKotlinDslPluginTest extends Specification {
.build()
when: "build is invoked"
BuildResult result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments('build', '--stacktrace')
.withPluginClasspath()
.withGradleVersion(gradleVersion)
.forwardStdOutput(new OutputStreamWriter(System.out))
.forwardStdError(new OutputStreamWriter(System.err))
// Enabling debug causes the test to fail.
// https://github.com/gradle/gradle/issues/6862
//.withDebug(true)
.build()
BuildResult result = ProtobufPluginTestHelper.getGradleRunner(
projectDir,
gradleVersion,
"build"
).build()
then: "it succeed"
result.task(":build").outcome == TaskOutcome.SUCCESS
Expand Down

0 comments on commit 3196f30

Please sign in to comment.