[7.x] Run pipeline scripts with runbld (#45844) (#46020)

Change how runbld is invoked, and skip junit processing by default
This commit is contained in:
Brian Seeders 2019-09-18 13:17:09 -04:00 committed by GitHub
parent 1cb8098c16
commit e8659817d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 3 deletions

6
.ci/runbld_no_junit.yml Normal file
View file

@ -0,0 +1,6 @@
# This file is not picked up by anything automatically
# It is used by being passed as an argument to runbld, when automatic processing of junit reports is not desired
profiles:
- ".*": # Match any job
tests:
junit-filename-pattern: "8d8bd494-d909-4e67-a052-7e8b5aaeb5e4" # A bogus path that should never exist

16
Jenkinsfile vendored
View file

@ -80,6 +80,10 @@ def withWorkers(name, preWorkerClosure = {}, workerClosures = [:]) {
uploadAllGcsArtifacts(name)
}
catchError {
runbldJunit()
}
catchError {
publishJunit()
}
@ -142,7 +146,7 @@ def legacyJobRunner(name) {
]) {
jobRunner('linux && immutable') {
try {
runbld '.ci/run.sh'
runbld('.ci/run.sh', true)
} finally {
catchError {
uploadAllGcsArtifacts(name)
@ -253,8 +257,14 @@ def sendKibanaMail() {
}
}
def runbld(script) {
sh '#!/usr/local/bin/runbld\n' + script
def runbld(script, enableJunitProcessing = false) {
def extraConfig = enableJunitProcessing ? "" : "--config ${env.WORKSPACE}/kibana/.ci/runbld_no_junit.yml"
sh "/usr/local/bin/runbld -d '${pwd()}' ${extraConfig} ${script}"
}
def runbldJunit() {
sh "/usr/local/bin/runbld -d '${pwd()}' ${env.WORKSPACE}/kibana/test/scripts/jenkins_runbld_junit.sh"
}
def bash(script) {

View file

@ -136,3 +136,19 @@ function checks-reporter-with-killswitch() {
export -f checks-reporter-with-killswitch
source "$KIBANA_DIR/src/dev/ci_setup/load_env_keys.sh"
ES_DIR="$PARENT_DIR/elasticsearch"
ES_JAVA_PROP_PATH=$ES_DIR/.ci/java-versions.properties
if [[ -d "$ES_DIR" && -f "$ES_JAVA_PROP_PATH" ]]; then
ES_BUILD_JAVA="$(grep "^ES_BUILD_JAVA" "$ES_JAVA_PROP_PATH" | cut -d'=' -f2 | tr -d '[:space:]')"
export ES_BUILD_JAVA
if [ -z "$ES_BUILD_JAVA" ]; then
echo "Unable to set JAVA_HOME, ES_BUILD_JAVA not present in $ES_JAVA_PROP_PATH"
exit 1
fi
echo "Setting JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA"
export JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
fi

View file

@ -0,0 +1,2 @@
# This file just exists to give runbld something to invoke before processing junit reports
echo 'Processing junit reports with runbld...'