Skip to content

Commit

Permalink
Fully enable configuration cache test (#467)
Browse files Browse the repository at this point in the history
Bumps osdetector plugin version to 1.7.0 and removes flags for ignoring configuration cache problems in tests.
  • Loading branch information
voidzcy authored Feb 10, 2021
1 parent 371b114 commit 63271b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
compileOnly "com.android.tools.build:gradle:3.5.0"

compile 'com.google.guava:guava:27.0.1-jre'
compile 'com.google.gradle:osdetector-gradle-plugin:1.6.2'
compile 'com.google.gradle:osdetector-gradle-plugin:1.7.0'
compile 'commons-lang:commons-lang:2.6'

testCompile 'junit:junit:4.12'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import spock.lang.Unroll
*/
@CompileDynamic
class ProtobufAndroidPluginTest extends Specification {
private static final List<String> GRADLE_VERSION = ["5.6", "6.5-milestone-1"]
private static final List<String> ANDROID_PLUGIN_VERSION = ["3.5.0", "4.1.0-alpha10"]
private static final List<String> GRADLE_VERSION = ["5.6", "6.5", "6.8"]
private static final List<String> ANDROID_PLUGIN_VERSION = ["3.5.0", "4.1.0", "4.2.0-alpha10"]

@Unroll
void "testProjectAndroid should be successfully executed [android #agpVersion, gradle #gradleVersion]"() {
Expand Down Expand Up @@ -70,8 +70,7 @@ class ProtobufAndroidPluginTest extends Specification {
mainProjectDir,
gradleVersion,
"testProjectAndroid:assembleDebug",
"-Dorg.gradle.unsafe.instant-execution=true",
"-Dorg.gradle.unsafe.instant-execution.fail-on-problems=false"
"-Dorg.gradle.unsafe.configuration-cache=true"
)
when: "build is invoked"
BuildResult result = runner.build()
Expand All @@ -86,7 +85,7 @@ class ProtobufAndroidPluginTest extends Specification {
result = runner.build()

then: "it reuses the task graph"
result.output.contains("Reusing instant execution cache")
result.output.contains("Reusing configuration cache")

and: "it is up to date"
result.task(":testProjectAndroid:assembleDebug").outcome == TaskOutcome.UP_TO_DATE
Expand All @@ -96,8 +95,7 @@ class ProtobufAndroidPluginTest extends Specification {
mainProjectDir,
gradleVersion,
"testProjectAndroid:clean",
"-Dorg.gradle.unsafe.instant-execution=true",
"-Dorg.gradle.unsafe.instant-execution.fail-on-problems=false"
"-Dorg.gradle.unsafe.configuration-cache=true"
)
result = runner.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ class ProtobufJavaPluginTest extends Specification {
.withProjectDir(projectDir)
.withArguments(
'build', '--stacktrace',
'--configuration-cache',
'--configuration-cache-problems=warn'
'--configuration-cache'
)
.withPluginClasspath()
.withGradleVersion(gradleVersion)
Expand Down

0 comments on commit 63271b7

Please sign in to comment.