Apache Lucene open-source search software
Detect CI builds and enable errorprone by default for those CI builds (#890)
Uwe Schindler7a8071c9d4bf
diff --git a/gradle/globals.gradle b/gradle/globals.gradleindex 4650a11c971..60e5101437e 100644--- a/gradle/globals.gradle+++ b/gradle/globals.gradle@@ -147,5 +147,10 @@ allprojects {}return taskList}++ // detect if we run in CI environment by looking at existence of env vars:+ // "CI": Github (https://docs.github.com/en/actions/learn-github-actions/environment-variables)+ // anything starting with "JENKINS_" or "HUDSON_": Jenkins/Hudson (https://jenkins.thetaphi.de/env-vars.html/)+ isCIBuild = System.getenv().keySet().find { it ==~ /(?i)((JENKINS|HUDSON)(_\w+)?|CI)/ } != null}}diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradleindex 5ca48a7211c..67c0ea20ca0 100644--- a/gradle/validation/error-prone.gradle+++ b/gradle/validation/error-prone.gradle@@ -21,8 +21,8 @@ if (rootProject.usesAltJvm && rootProject.runtimeJavaVersion > JavaVersion.VERSIskipReason = "won't work with JDK ${rootProject.runtimeJavaVersion} if used as alternative java toolchain"}-if (!Boolean.parseBoolean(propertyOrDefault("tests.nightly", "false"))) {- skipReason = "skipped on non-nightly runs, pass -Ptests.nightly=true to run"+if (!propertyOrDefault("validation.errorprone", isCIBuild).asBoolean()) {+ skipReason = "skipped on builds not running inside CI environments, pass -Pvalidation.errorprone=true to enable"}if (skipReason) {diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex e5bba1efd56..8ccf0ee3dee 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -211,7 +211,9 @@ Build* Upgrade forbiddenapis to version 3.3. (Uwe Schindler)-* LUCENE-10532: Remove LuceneTestCase.Slow annotation. ALl tests can be fast. (Robert Muir)+* Detect CI builds on Github or Jenkins and enable errorprone. (Uwe Schindler, Dawid Weiss)++* LUCENE-10532: Remove LuceneTestCase.Slow annotation. All tests can be fast. (Robert Muir)Other---------------------