Skip to content

Commit

Permalink
[7.x] Run pipeline scripts with runbld (elastic#45844) (elastic#46020)
Browse files Browse the repository at this point in the history
Change how runbld is invoked, and skip junit processing by default
  • Loading branch information
brianseeders authored Sep 18, 2019
1 parent 1cb8098 commit e865981
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .ci/runbld_no_junit.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def withWorkers(name, preWorkerClosure = {}, workerClosures = [:]) {
uploadAllGcsArtifacts(name)
}

catchError {
runbldJunit()
}

catchError {
publishJunit()
}
Expand Down Expand Up @@ -142,7 +146,7 @@ def legacyJobRunner(name) {
]) {
jobRunner('linux && immutable') {
try {
runbld '.ci/run.sh'
runbld('.ci/run.sh', true)
} finally {
catchError {
uploadAllGcsArtifacts(name)
Expand Down Expand Up @@ -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) {
Expand Down
16 changes: 16 additions & 0 deletions src/dev/ci_setup/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions test/scripts/jenkins_runbld_junit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file just exists to give runbld something to invoke before processing junit reports
echo 'Processing junit reports with runbld...'

0 comments on commit e865981

Please sign in to comment.