Skip to content

Commit e2f49a0

Browse files
committed
!!! REVERT !!! Enable all tests, disable gradle scan
1 parent e615dda commit e2f49a0

File tree

3 files changed

+31
-46
lines changed

3 files changed

+31
-46
lines changed

.github/workflows/testing.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: GitHub Actions Linux Testing
33
on:
44
push:
55
branches:
6-
- master
6+
- master
77
pull_request:
88

99
permissions:
@@ -21,14 +21,13 @@ jobs:
2121
- uses: gradle/gradle-build-action@v2
2222
with:
2323
arguments: clean assemble --stacktrace
24-
24+
2525
test:
2626
needs: build
2727
strategy:
2828
matrix:
29-
tests: [ProtobufKotlinDslPluginTest]
29+
tests: [ProtobufJavaPluginTest, ProtobufKotlinDslCopySpecTest, ProtobufKotlinDslPluginTest, ProtobufAndroidPluginTest, ProtobufAndroidPluginKotlinTest, AndroidProjectDetectionTest]
3030
runs-on: ubuntu-latest
31-
timeout-minutes: 30
3231
steps:
3332
- uses: actions/checkout@v2
3433
- uses: actions/setup-java@v2

src/test/groovy/com/google/protobuf/gradle/ProtobufKotlinDslPluginTest.groovy

+28-29
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ class ProtobufKotlinDslPluginTest extends Specification {
1717
private static final List<String> GRADLE_VERSIONS = [/*"5.6", "6.1.1", "6.5",*/ "7.4.2"]
1818
private static final List<String> ANDROID_PLUGIN_VERSION = [/*"3.5.0", "4.0.0", "4.1.0",*/ "7.2.1"]
1919

20-
// @Unroll
21-
// void "testProjectKotlinDsl should be successfully executed (java-only project) [gradle #gradleVersion]"() {
22-
// given: "project from testProjectKotlinDslBase"
23-
// File projectDir = ProtobufPluginTestHelper.projectBuilder('testProjectKotlinDsl')
24-
// .copyDirs('testProjectKotlinDslBase')
25-
// .build()
26-
//
27-
// when: "build is invoked"
28-
// BuildResult result = GradleRunner.create()
29-
// .withProjectDir(projectDir)
30-
// .withArguments('build', '--stacktrace')
31-
// .withPluginClasspath()
32-
// .withGradleVersion(gradleVersion)
33-
// .forwardStdOutput(new OutputStreamWriter(System.out))
34-
// .forwardStdError(new OutputStreamWriter(System.err))
35-
// // Enabling debug causes the test to fail.
36-
// // https://github.com/gradle/gradle/issues/6862
37-
// //.withDebug(true)
38-
// .build()
39-
//
40-
// then: "it succeed"
41-
// result.task(":build").outcome == TaskOutcome.SUCCESS
42-
// ProtobufPluginTestHelper.verifyProjectDir(projectDir)
43-
//
44-
// where:
45-
// gradleVersion << GRADLE_VERSIONS
46-
// }
20+
@Unroll
21+
void "testProjectKotlinDsl should be successfully executed (java-only project) [gradle #gradleVersion]"() {
22+
given: "project from testProjectKotlinDslBase"
23+
File projectDir = ProtobufPluginTestHelper.projectBuilder('testProjectKotlinDsl')
24+
.copyDirs('testProjectKotlinDslBase')
25+
.build()
26+
27+
when: "build is invoked"
28+
BuildResult result = GradleRunner.create()
29+
.withProjectDir(projectDir)
30+
.withArguments('build', '--stacktrace')
31+
.withPluginClasspath()
32+
.withGradleVersion(gradleVersion)
33+
.forwardStdOutput(new OutputStreamWriter(System.out))
34+
.forwardStdError(new OutputStreamWriter(System.err))
35+
// Enabling debug causes the test to fail.
36+
// https://github.com/gradle/gradle/issues/6862
37+
//.withDebug(true)
38+
.build()
39+
40+
then: "it succeed"
41+
result.task(":build").outcome == TaskOutcome.SUCCESS
42+
ProtobufPluginTestHelper.verifyProjectDir(projectDir)
43+
44+
where:
45+
gradleVersion << GRADLE_VERSIONS
46+
}
4747
4848
@Unroll
4949
void "testProjectAndroidKotlinDsl should be successfully executed [android #agpVersion, gradle #gradleVersion]"() {
@@ -64,8 +64,7 @@ class ProtobufKotlinDslPluginTest extends Specification {
6464
mainProjectDir,
6565
gradleVersion,
6666
agpVersion,
67-
"testProjectAndroidKotlinDsl:build",
68-
"--scan"
67+
"testProjectAndroidKotlinDsl:build"
6968
)
7069
7170
then: "it succeed"

src/test/groovy/com/google/protobuf/gradle/ProtobufPluginTestHelper.groovy

-13
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,6 @@ final class ProtobufPluginTestHelper {
128128
File settingsFile = new File(projectDir, 'settings.gradle')
129129
settingsFile.createNewFile()
130130

131-
settingsFile << """
132-
plugins {
133-
id "com.gradle.enterprise" version "3.10.2"
134-
}
135-
136-
gradleEnterprise {
137-
buildScan {
138-
termsOfServiceUrl = "https://gradle.com/terms-of-service"
139-
termsOfServiceAgree = "yes"
140-
}
141-
}
142-
"""
143-
144131
subProjects.each {
145132
File subProjectDir = new File(projectDir.path, it.name)
146133
FileUtils.copyDirectory(it, subProjectDir)

0 commit comments

Comments
 (0)