Split build benchmark jobs for faster feedback (#84978)

Also handle gradle-profiler introduced spotless issue when running performance tests
This commit is contained in:
Rene Groeschke 2022-03-16 12:34:54 +01:00 committed by GitHub
parent bb858cf4b7
commit f2a117095b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 118 additions and 62 deletions

View file

@ -59,7 +59,6 @@ public class FormattingPrecommitPlugin implements Plugin<Project> {
}
java.target("src/**/*.java");
java.removeUnusedImports();
// We enforce a standard order for imports
@ -72,6 +71,13 @@ public class FormattingPrecommitPlugin implements Plugin<Project> {
// order, apply this one last, otherwise non-empty blank lines can creep
// in.
java.trimTrailingWhitespace();
// When running build benchmarks we alter the source in some scenarios.
// The gradle-profiler unfortunately does not generate compliant formatted
// sources so we ignore that altered file when running build benchmarks
if(Boolean.getBoolean("BUILD_PERFORMANCE_TEST") && project.getPath().equals(":server")) {
java.ignoreErrorForPath("src/main/java/org/elasticsearch/bootstrap/BootstrapInfo.java");
}
});
project.getTasks().named("precommit").configure(precommitTask -> precommitTask.dependsOn("spotlessJavaCheck"));