You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2022/05/14 18:51:12 UTC
[lucene] branch branch_9x updated: Detect CI builds and enable errorprone by default for those CI builds (#890)
This is an automated email from the ASF dual-hosted git repository.
uschindler pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new fbb3bd56c97 Detect CI builds and enable errorprone by default for those CI builds (#890)
fbb3bd56c97 is described below
commit fbb3bd56c9709fdcc8b695431397a99663446b09
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Sat May 14 20:49:50 2022 +0200
Detect CI builds and enable errorprone by default for those CI builds (#890)
---
gradle/globals.gradle | 5 +++++
gradle/validation/error-prone.gradle | 4 ++--
lucene/CHANGES.txt | 4 +++-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/gradle/globals.gradle b/gradle/globals.gradle
index 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.gradle
index 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.VERSI
skipReason = "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.txt
index 3bcdc5c6db4..392ecdbc15d 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -149,7 +149,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
---------------------