diff --git a/gradle/core/build.gradle b/gradle/core/build.gradle index d1c4d03c0..bc64f1105 100644 --- a/gradle/core/build.gradle +++ b/gradle/core/build.gradle @@ -41,6 +41,19 @@ def fragileTestPatterns = [ "google/registry/model/server/KmsSecretRevisionTest.*" ] +// Tests that fail when running Gradle in a docker container, e. g. when +// building the release artifacts in Google Cloud Build. +def dockerIncompatibleTestPatterns = [ + // The webdriver tests start headless Chrome in a Docker container, + // resulting in Docker-in-Docker complications. + "google/registry/webdriver/*", + // PathParameterTest includes tests which validate that file permissions are + // respected. However when running in Docker the user is root by default, so + // every file is read/write-able. There is no way to exclude specific test + // methods, so we exclude the whole test class. + "google/registry/tools/params/PathParameterTest.*" +] + sourceSets { main { java { @@ -636,6 +649,10 @@ test { exclude fragileTestPatterns exclude outcastTestPatterns + if (rootProject.findProperty("skipDockerIncompatibleTests") == "true") { + exclude dockerIncompatibleTestPatterns + } + // Run every test class in its own process. // Uncomment to unblock build while troubleshooting inexplicable test errors. // This setting makes the build take 35 minutes, without it it takes about 10. diff --git a/gradle/gradle/wrapper/gradle-wrapper.properties b/gradle/gradle/wrapper/gradle-wrapper.properties index 5f1b1201a..f4d7b2bf6 100644 --- a/gradle/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/release/cloudbuild-nomulus.yaml b/release/cloudbuild-nomulus.yaml index da2c2cb27..6c3fb2fda 100644 --- a/release/cloudbuild-nomulus.yaml +++ b/release/cloudbuild-nomulus.yaml @@ -26,7 +26,7 @@ steps: args: ['mkdir', 'nomulus'] # Run tests - name: 'gcr.io/${PROJECT_ID}/builder:latest' - args: ['./gradlew', 'test'] + args: ['./gradlew', 'test', '-PskipDockerIncompatibleTests=true'] dir: 'gradle' # Build and package the deployment files for alpha. - name: 'gcr.io/${PROJECT_ID}/builder:latest'