Remove matrix build support (#54202) (#56171)

This commit is contained in:
Brian Seeders 2020-01-28 16:57:21 -05:00 committed by GitHub
parent f9d72bbb4c
commit 0b4d3c117e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 198 additions and 285 deletions

112
.ci/Jenkinsfile_coverage Normal file
View file

@ -0,0 +1,112 @@
#!/bin/groovy
library 'kibana-pipeline-library'
kibanaLibrary.load() // load from the Jenkins instance
stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a little bit
timeout(time: 180, unit: 'MINUTES') {
timestamps {
ansiColor('xterm') {
catchError {
withEnv([
'CODE_COVERAGE=1', // Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
]) {
parallel([
'kibana-intake-agent': {
withEnv([
'NODE_ENV=test' // Needed for jest tests only
]) {
kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh')()
}
},
'x-pack-intake-agent': {
withEnv([
'NODE_ENV=test' // Needed for jest tests only
]) {
kibanaPipeline.intakeWorker('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
}
},
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
]),
'kibana-xpack-agent-1': kibanaPipeline.withWorkers('kibana-xpack-tests-1', { kibanaPipeline.buildXpack() }, [
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
]),
'kibana-xpack-agent-2': kibanaPipeline.withWorkers('kibana-xpack-tests-2', { kibanaPipeline.buildXpack() }, [
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
]),
'kibana-xpack-agent-3': kibanaPipeline.withWorkers('kibana-xpack-tests-3', { kibanaPipeline.buildXpack() }, [
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
]),
])
kibanaPipeline.jobRunner('tests-l', false) {
kibanaPipeline.downloadCoverageArtifacts()
kibanaPipeline.bash(
'''
# bootstrap from x-pack folder
source src/dev/ci_setup/setup_env.sh
cd x-pack
yarn kbn bootstrap --prefer-offline
cd ..
# extract archives
mkdir -p /tmp/extracted_coverage
echo extracting intakes
tar -xzf /tmp/downloaded_coverage/coverage/kibana-intake/kibana-coverage.tar.gz -C /tmp/extracted_coverage
tar -xzf /tmp/downloaded_coverage/coverage/x-pack-intake/kibana-coverage.tar.gz -C /tmp/extracted_coverage
echo extracting kibana-oss-tests
tar -xzf /tmp/downloaded_coverage/coverage/kibana-oss-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
echo extracting kibana-xpack-tests
for i in {1..3}; do
tar -xzf /tmp/downloaded_coverage/coverage/kibana-xpack-tests-${i}/kibana-coverage.tar.gz -C /tmp/extracted_coverage
done
# replace path in json files to have valid html report
pwd=$(pwd)
du -sh /tmp/extracted_coverage/target/kibana-coverage/
echo replacing path in json files
for i in {1..9}; do
sed -i "s|/dev/shm/workspace/kibana|$pwd|g" /tmp/extracted_coverage/target/kibana-coverage/functional/${i}*.json &
done
wait
# merge oss & x-pack reports
echo merging coverage reports
yarn nyc report --temp-dir /tmp/extracted_coverage/target/kibana-coverage/jest --report-dir target/kibana-coverage/jest-combined --reporter=html --reporter=json-summary
yarn nyc report --temp-dir /tmp/extracted_coverage/target/kibana-coverage/functional --report-dir target/kibana-coverage/functional-combined --reporter=html --reporter=json-summary
echo copy mocha reports
mkdir -p target/kibana-coverage/mocha-combined
cp -r /tmp/extracted_coverage/target/kibana-coverage/mocha target/kibana-coverage/mocha-combined
''',
"run `yarn kbn bootstrap && merge coverage`"
)
sh 'tar -czf kibana-jest-coverage.tar.gz target/kibana-coverage/jest-combined/*'
kibanaPipeline.uploadCoverageArtifacts("coverage/jest-combined", 'kibana-jest-coverage.tar.gz')
sh 'tar -czf kibana-functional-coverage.tar.gz target/kibana-coverage/functional-combined/*'
kibanaPipeline.uploadCoverageArtifacts("coverage/functional-combined", 'kibana-functional-coverage.tar.gz')
sh 'tar -czf kibana-mocha-coverage.tar.gz target/kibana-coverage/mocha-combined/*'
kibanaPipeline.uploadCoverageArtifacts("coverage/mocha-combined", 'kibana-mocha-coverage.tar.gz')
}
}
}
kibanaPipeline.sendMail()
}
}
}
}

View file

@ -26,8 +26,8 @@ timeout(time: 120, unit: 'MINUTES') {
withEnv(["ES_SNAPSHOT_MANIFEST=${SNAPSHOT_MANIFEST}"]) {
parallel([
// TODO we just need to run integration tests from intake?
'kibana-intake-agent': kibanaPipeline.legacyJobRunner('kibana-intake'),
'x-pack-intake-agent': kibanaPipeline.legacyJobRunner('x-pack-intake'),
'kibana-intake-agent': kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh'),
'x-pack-intake-agent': kibanaPipeline.intakeWorker('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),

View file

@ -1,3 +1,5 @@
# This file is needed by functionalTests:ensureAllTestsInCiGroup for the list of ciGroups. That must be changed before this file can be removed
JOB:
- kibana-intake
- x-pack-intake

View file

@ -1,50 +0,0 @@
#!/usr/bin/env bash
set -e
# move to Kibana root
cd "$(dirname "$0")/.."
source src/dev/ci_setup/load_env_keys.sh
source src/dev/ci_setup/extract_bootstrap_cache.sh
source src/dev/ci_setup/setup.sh
source src/dev/ci_setup/checkout_sibling_es.sh
case "$JOB" in
kibana-intake)
./test/scripts/jenkins_unit.sh
;;
kibana-ciGroup*)
export CI_GROUP="${JOB##kibana-ciGroup}"
./test/scripts/jenkins_ci_group.sh
;;
kibana-visualRegression*)
./test/scripts/jenkins_visual_regression.sh
;;
kibana-accessibility*)
./test/scripts/jenkins_accessibility.sh
;;
kibana-firefoxSmoke*)
./test/scripts/jenkins_firefox_smoke.sh
;;
x-pack-intake)
./test/scripts/jenkins_xpack.sh
;;
x-pack-ciGroup*)
export CI_GROUP="${JOB##x-pack-ciGroup}"
./test/scripts/jenkins_xpack_ci_group.sh
;;
x-pack-visualRegression*)
./test/scripts/jenkins_xpack_visual_regression.sh
;;
x-pack-accessibility*)
./test/scripts/jenkins_xpack_accessibility.sh
;;
x-pack-firefoxSmoke*)
./test/scripts/jenkins_xpack_firefox_smoke.sh
;;
*)
echo "JOB '$JOB' is not implemented."
exit 1
;;
esac

4
Jenkinsfile vendored
View file

@ -11,8 +11,8 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
catchError {
retryable.enable()
parallel([
'kibana-intake-agent': kibanaPipeline.legacyJobRunner('kibana-intake'),
'x-pack-intake-agent': kibanaPipeline.legacyJobRunner('x-pack-intake'),
'kibana-intake-agent': kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh'),
'x-pack-intake-agent': kibanaPipeline.intakeWorker('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', {
retryable('kibana-firefoxSmoke') {

View file

@ -1,23 +1,6 @@
#!/usr/bin/env bash
set -e
if [[ -n "$IS_PIPELINE_JOB" ]] ; then
source src/dev/ci_setup/setup_env.sh
fi
export TEST_BROWSER_HEADLESS=1
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
yarn run grunt functionalTests:ensureAllTestsInCiGroup;
node scripts/build --debug --oss;
else
installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)"
destDir=${installDir}-${CI_WORKER_NUMBER}
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi
source test/scripts/jenkins_test_setup_oss.sh
checks-reporter-with-killswitch "Kibana accessibility tests" \
node scripts/functional_tests \

View file

@ -1,17 +1,6 @@
#!/usr/bin/env bash
source test/scripts/jenkins_test_setup.sh
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
yarn run grunt functionalTests:ensureAllTestsInCiGroup;
node scripts/build --debug --oss;
else
installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)"
destDir=${installDir}-${CI_WORKER_NUMBER}
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi
source test/scripts/jenkins_test_setup_oss.sh
checks-reporter-with-killswitch "Functional tests / Group ${CI_GROUP}" yarn run grunt "run:functionalTests_ciGroup${CI_GROUP}";
@ -20,4 +9,4 @@ if [ "$CI_GROUP" == "1" ]; then
yarn run grunt run:pluginFunctionalTestsRelease --from=source;
yarn run grunt run:exampleFunctionalTestsRelease --from=source;
yarn run grunt run:interpreterFunctionalTestsRelease;
fi
fi

View file

@ -1,22 +1,6 @@
#!/usr/bin/env bash
source test/scripts/jenkins_test_setup.sh
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
node scripts/build --debug --oss;
linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-oss-*-linux-x86_64.tar.gz')"
installDir="$PARENT_DIR/install/kibana"
mkdir -p "$installDir"
tar -xzf "$linuxBuild" -C "$installDir" --strip=1
else
installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)"
destDir=${installDir}-${CI_WORKER_NUMBER}
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi
export TEST_BROWSER_HEADLESS=1
source test/scripts/jenkins_test_setup_oss.sh
checks-reporter-with-killswitch "Firefox smoke test" \
node scripts/functional_tests \

View file

@ -1,11 +1,9 @@
#!/usr/bin/env bash
set -e
function post_work() {
set +e
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
node "$KIBANA_DIR/scripts/report_failed_tests"
fi
if [[ -z "$REMOVE_KIBANA_INSTALL_DIR" && -z "$KIBANA_INSTALL_DIR" && -d "$KIBANA_INSTALL_DIR" ]]; then
rm -rf "$REMOVE_KIBANA_INSTALL_DIR"
fi
@ -15,6 +13,4 @@ trap 'post_work' EXIT
export TEST_BROWSER_HEADLESS=1
if [[ -n "$IS_PIPELINE_JOB" ]] ; then
source src/dev/ci_setup/setup_env.sh
fi
source src/dev/ci_setup/setup_env.sh

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
source test/scripts/jenkins_test_setup.sh
if [[ -z "$CODE_COVERAGE" ]] ; then
installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)"
destDir=${installDir}-${CI_WORKER_NUMBER}
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi

View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
source test/scripts/jenkins_test_setup.sh
if [[ -z "$CODE_COVERAGE" ]]; then
installDir="$PARENT_DIR/install/kibana"
destDir="${installDir}-${CI_WORKER_NUMBER}"
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
cd "$XPACK_DIR"
fi

View file

@ -1,7 +1,5 @@
#!/usr/bin/env bash
set -e
export TEST_BROWSER_HEADLESS=1
source test/scripts/jenkins_test_setup.sh
"$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:unit --dev;

View file

@ -1,22 +1,8 @@
#!/usr/bin/env bash
source test/scripts/jenkins_test_setup.sh
source test/scripts/jenkins_test_setup_xpack.sh
source "$KIBANA_DIR/src/dev/ci_setup/setup_percy.sh"
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
node scripts/build --debug --oss;
linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-oss-*-linux-x86_64.tar.gz')"
installDir="$PARENT_DIR/install/kibana"
mkdir -p "$installDir"
tar -xzf "$linuxBuild" -C "$installDir" --strip=1
else
installDir="$(realpath $PARENT_DIR/kibana/build/oss/kibana-*-SNAPSHOT-linux-x86_64)"
destDir=${installDir}-${CI_WORKER_NUMBER}
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi
checks-reporter-with-killswitch "Kibana visual regression tests" \
yarn run percy exec -t 500 \
node scripts/functional_tests \

View file

@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -e
export TEST_BROWSER_HEADLESS=1
source test/scripts/jenkins_test_setup.sh
echo " -> Running mocha tests"
cd "$XPACK_DIR"

View file

@ -1,32 +1,6 @@
#!/usr/bin/env bash
set -e
if [[ -n "$IS_PIPELINE_JOB" ]] ; then
source src/dev/ci_setup/setup_env.sh
fi
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
echo " -> building and extracting default Kibana distributable for use in functional tests"
node scripts/build --debug --no-oss
linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-*-linux-x86_64.tar.gz')"
installDir="$PARENT_DIR/install/kibana"
mkdir -p "$installDir"
tar -xzf "$linuxBuild" -C "$installDir" --strip=1
export KIBANA_INSTALL_DIR="$installDir"
else
installDir="$PARENT_DIR/install/kibana"
destDir="${installDir}-${CI_WORKER_NUMBER}"
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi
export TEST_BROWSER_HEADLESS=1
cd "$XPACK_DIR"
source test/scripts/jenkins_test_setup_xpack.sh
checks-reporter-with-killswitch "X-Pack accessibility tests" \
node scripts/functional_tests \

View file

@ -1,43 +1,6 @@
#!/usr/bin/env bash
source test/scripts/jenkins_test_setup.sh
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
echo " -> Ensuring all functional tests are in a ciGroup"
cd "$XPACK_DIR"
node scripts/functional_tests --assert-none-excluded \
--include-tag ciGroup1 \
--include-tag ciGroup2 \
--include-tag ciGroup3 \
--include-tag ciGroup4 \
--include-tag ciGroup5 \
--include-tag ciGroup6 \
--include-tag ciGroup7 \
--include-tag ciGroup8 \
--include-tag ciGroup9 \
--include-tag ciGroup10
fi
cd "$KIBANA_DIR"
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
echo " -> building and extracting default Kibana distributable for use in functional tests"
node scripts/build --debug --no-oss
linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-*-linux-x86_64.tar.gz')"
installDir="$PARENT_DIR/install/kibana"
mkdir -p "$installDir"
tar -xzf "$linuxBuild" -C "$installDir" --strip=1
export KIBANA_INSTALL_DIR="$installDir"
else
installDir="$PARENT_DIR/install/kibana"
destDir="${installDir}-${CI_WORKER_NUMBER}"
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi
source test/scripts/jenkins_test_setup_xpack.sh
echo " -> Running functional and api tests"
cd "$XPACK_DIR"
@ -47,14 +10,3 @@ checks-reporter-with-killswitch "X-Pack Chrome Functional tests / Group ${CI_GRO
--debug --bail \
--kibana-install-dir "$KIBANA_INSTALL_DIR" \
--include-tag "ciGroup$CI_GROUP"
echo ""
echo ""
# checks-reporter-with-killswitch "X-Pack Firefox Functional tests / Group ${CI_GROUP}" \
# node scripts/functional_tests --debug --bail \
# --kibana-install-dir "$installDir" \
# --include-tag "ciGroup$CI_GROUP" \
# --config "test/functional/config.firefox.js"
# echo ""
# echo ""

View file

@ -1,23 +1,6 @@
#!/usr/bin/env bash
source test/scripts/jenkins_test_setup.sh
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
node scripts/build --debug --no-oss;
linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-*-linux-x86_64.tar.gz')"
installDir="$PARENT_DIR/install/kibana"
mkdir -p "$installDir"
tar -xzf "$linuxBuild" -C "$installDir" --strip=1
export KIBANA_INSTALL_DIR="$installDir"
else
installDir="$PARENT_DIR/install/kibana"
destDir="${installDir}-${CI_WORKER_NUMBER}"
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi
cd "$XPACK_DIR"
source test/scripts/jenkins_test_setup_xpack.sh
checks-reporter-with-killswitch "X-Pack firefox smoke test" \
node scripts/functional_tests \

View file

@ -1,25 +1,8 @@
#!/usr/bin/env bash
source test/scripts/jenkins_test_setup.sh
source test/scripts/jenkins_test_setup_xpack.sh
source "$KIBANA_DIR/src/dev/ci_setup/setup_percy.sh"
if [[ -z "$IS_PIPELINE_JOB" ]] ; then
node scripts/build --debug --no-oss;
linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-*-linux-x86_64.tar.gz')"
installDir="$PARENT_DIR/install/kibana"
mkdir -p "$installDir"
tar -xzf "$linuxBuild" -C "$installDir" --strip=1
export KIBANA_INSTALL_DIR="$installDir"
else
installDir="$PARENT_DIR/install/kibana"
destDir="${installDir}-${CI_WORKER_NUMBER}"
cp -R "$installDir" "$destDir"
export KIBANA_INSTALL_DIR="$destDir"
fi
cd "$XPACK_DIR"
checks-reporter-with-killswitch "X-Pack visual regression tests" \
yarn run percy exec -t 500 \
node scripts/functional_tests \

View file

@ -2,7 +2,7 @@ def withWorkers(machineName, preWorkerClosure = {}, workerClosures = [:]) {
return {
jobRunner('tests-xl', true) {
withGcsArtifactUpload(machineName, {
try {
withPostBuildReporting {
doSetup()
preWorkerClosure()
@ -26,24 +26,53 @@ def withWorkers(machineName, preWorkerClosure = {}, workerClosures = [:]) {
}
parallel(workers)
} finally {
catchError {
runErrorReporter()
}
catchError {
runbld.junit()
}
catchError {
publishJunit()
}
}
})
}
}
}
def withWorker(machineName, label, Closure closure) {
return {
jobRunner(label, false) {
withGcsArtifactUpload(machineName) {
withPostBuildReporting {
doSetup()
closure()
}
}
}
}
}
def intakeWorker(jobName, String script) {
return withWorker(jobName, 'linux && immutable') {
withEnv([
"JOB=${jobName}",
]) {
runbld(script, "Execute ${jobName}")
}
}
}
def withPostBuildReporting(Closure closure) {
try {
closure()
} finally {
catchError {
runErrorReporter()
}
catchError {
runbld.junit()
}
catchError {
publishJunit()
}
}
}
def getPostBuildWorker(name, closure) {
return { workerNumber ->
def kibanaPort = "61${workerNumber}1"
@ -90,34 +119,6 @@ def getXpackCiGroupWorker(ciGroup) {
})
}
def legacyJobRunner(name) {
return {
parallel([
"${name}": {
withEnv([
"JOB=${name}",
]) {
jobRunner('linux && immutable', false) {
withGcsArtifactUpload(name, {
try {
runbld('.ci/run.sh', "Execute ${name}", true)
} finally {
catchError {
runErrorReporter()
}
catchError {
publishJunit()
}
}
})
}
}
}
])
}
}
def jobRunner(label, useRamDisk, closure) {
node(label) {
agentInfo.print()
@ -168,8 +169,6 @@ def jobRunner(label, useRamDisk, closure) {
}
}
// TODO what should happen if GCS, Junit, or email publishing fails? Unstable build? Failed build?
def uploadGcsArtifact(uploadPrefix, pattern) {
googleStorageUpload(
credentialsId: 'kibana-ci-gcs-plugin',