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 3080003
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
22 changes: 10 additions & 12 deletions src/test/groovy/com/google/protobuf/gradle/IDESupportTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,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 +129,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 @@ -23,17 +23,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 3080003

Please sign in to comment.