-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
156 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#!/usr/bin/env groovy | ||
|
||
library identifier: 'apm@current', | ||
retriever: modernSCM( | ||
[$class: 'GitSCMSource', | ||
credentialsId: 'f94e9298-83ae-417e-ba91-85c279771570', | ||
id: '37cf2c00-2cc7-482e-8c62-7bbffef475e2', | ||
remote: 'git@github.com:elastic/apm-pipeline-library.git']) | ||
|
||
pipeline { | ||
agent { label 'linux && immutable' } | ||
environment { | ||
BASE_DIR = 'src/github.com/elastic/kibana' | ||
HOME = "${env.WORKSPACE}" | ||
E2E_DIR = 'x-pack/plugins/apm/e2e' | ||
PIPELINE_LOG_LEVEL = 'DEBUG' | ||
} | ||
options { | ||
timeout(time: 1, unit: 'HOURS') | ||
buildDiscarder(logRotator(numToKeepStr: '40', artifactNumToKeepStr: '20', daysToKeepStr: '30')) | ||
timestamps() | ||
ansiColor('xterm') | ||
disableResume() | ||
durabilityHint('PERFORMANCE_OPTIMIZED') | ||
} | ||
triggers { | ||
issueCommentTrigger('(?i)(retest|.*jenkins\\W+run\\W+(?:the\\W+)?e2e?.*)') | ||
} | ||
parameters { | ||
booleanParam(name: 'FORCE', defaultValue: false, description: 'Whether to force the run.') | ||
} | ||
stages { | ||
stage('Checkout') { | ||
options { skipDefaultCheckout() } | ||
steps { | ||
deleteDir() | ||
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false, | ||
shallow: false, reference: "/var/lib/jenkins/.git-references/kibana.git") | ||
script { | ||
dir("${BASE_DIR}"){ | ||
def regexps =[ "^x-pack/plugins/apm/.*" ] | ||
env.APM_UPDATED = isGitRegionMatch(patterns: regexps) | ||
} | ||
} | ||
} | ||
} | ||
stage('Prepare Kibana') { | ||
options { skipDefaultCheckout() } | ||
when { | ||
anyOf { | ||
expression { return params.FORCE } | ||
expression { return env.APM_UPDATED != "false" } | ||
} | ||
} | ||
environment { | ||
JENKINS_NODE_COOKIE = 'dontKillMe' | ||
} | ||
steps { | ||
notifyStatus('Preparing kibana', 'PENDING') | ||
dir("${BASE_DIR}"){ | ||
sh "${E2E_DIR}/ci/prepare-kibana.sh" | ||
} | ||
} | ||
post { | ||
unsuccessful { | ||
notifyStatus('Kibana warm up failed', 'FAILURE') | ||
} | ||
} | ||
} | ||
stage('Smoke Tests'){ | ||
options { skipDefaultCheckout() } | ||
when { | ||
anyOf { | ||
expression { return params.FORCE } | ||
expression { return env.APM_UPDATED != "false" } | ||
} | ||
} | ||
steps{ | ||
notifyStatus('Running smoke tests', 'PENDING') | ||
dir("${BASE_DIR}"){ | ||
sh "${E2E_DIR}/ci/run-e2e.sh" | ||
} | ||
} | ||
post { | ||
always { | ||
dir("${BASE_DIR}/${E2E_DIR}"){ | ||
archiveArtifacts(allowEmptyArchive: false, artifacts: 'cypress/screenshots/**,cypress/videos/**,cypress/test-results/*e2e-tests.xml') | ||
junit(allowEmptyResults: true, testResults: 'cypress/test-results/*e2e-tests.xml') | ||
dir('tmp/apm-integration-testing'){ | ||
sh 'docker-compose logs > apm-its-docker.log || true' | ||
sh 'docker-compose down -v || true' | ||
archiveArtifacts(allowEmptyArchive: true, artifacts: 'apm-its-docker.log') | ||
} | ||
archiveArtifacts(allowEmptyArchive: true, artifacts: 'tmp/*.log') | ||
} | ||
} | ||
unsuccessful { | ||
notifyStatus('Test failures', 'FAILURE') | ||
} | ||
success { | ||
notifyStatus('Tests passed', 'SUCCESS') | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
dir("${BASE_DIR}"){ | ||
archiveArtifacts(allowEmptyArchive: true, artifacts: "${E2E_DIR}/kibana.log") | ||
} | ||
} | ||
} | ||
} | ||
|
||
def notifyStatus(String description, String status) { | ||
withGithubNotify.notify('end2end-for-apm-ui', description, status, getBlueoceanDisplayURL()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -ex | ||
|
||
E2E_DIR="x-pack/plugins/apm/e2e" | ||
|
||
echo "1/3 Install dependencies ..." | ||
E2E_DIR=x-pack/plugins/apm/e2e | ||
echo "1/2 Install dependencies ..." | ||
# shellcheck disable=SC1091 | ||
source src/dev/ci_setup/setup_env.sh true | ||
yarn kbn bootstrap | ||
|
||
echo "2/3 Ingest test data ..." | ||
pushd ${E2E_DIR} | ||
yarn install | ||
curl --silent https://storage.googleapis.com/apm-ui-e2e-static-data/events.json --output ingest-data/events.json | ||
node ingest-data/replay.js --server-url http://localhost:8201 --secret-token abcd --events ./events.json > ingest-data.log | ||
yarn kbn clean && yarn kbn bootstrap | ||
|
||
echo "3/3 Start Kibana ..." | ||
popd | ||
echo "2/2 Start Kibana ..." | ||
## Might help to avoid FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory | ||
export NODE_OPTIONS="--max-old-space-size=4096" | ||
nohup node scripts/kibana --config "${E2E_DIR}/ci/kibana.e2e.yml" --no-base-path --optimize.watch=false> kibana.log 2>&1 & | ||
nohup node ./scripts/kibana --no-base-path --no-watch --dev --no-dev-config --config ${E2E_DIR}/ci/kibana.e2e.yml > ${E2E_DIR}/kibana.log 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
## | ||
## This is a wrapper to configure the environment with the right tools in the CI | ||
## and run the e2e steps. | ||
## | ||
|
||
E2E_DIR="${0%/*}/.." | ||
# shellcheck disable=SC1091 | ||
source src/dev/ci_setup/setup_env.sh true | ||
set -ex | ||
"${E2E_DIR}"/run-e2e.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters