Test only oss integration test
This commit is contained in:
77
.ci/Jenkinsfile
vendored
77
.ci/Jenkinsfile
vendored
@ -114,71 +114,32 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('Integration test') {
|
stage('Integration test') {
|
||||||
failFast true
|
|
||||||
options { skipDefaultCheckout() }
|
options { skipDefaultCheckout() }
|
||||||
parallel {
|
environment {
|
||||||
stage('OSS') {
|
TEST_ES_SERVER = 'http://elasticsearch:9200'
|
||||||
agent { label 'docker && immutable' }
|
}
|
||||||
options { skipDefaultCheckout() }
|
steps {
|
||||||
environment {
|
withGithubNotify(context: 'Integration test OSS') {
|
||||||
TEST_ES_SERVER = 'http://elasticsearch:9200'
|
deleteDir()
|
||||||
}
|
unstash 'source-dependencies'
|
||||||
steps {
|
dir("${BASE_DIR}"){
|
||||||
withGithubNotify(context: 'Integration test OSS') {
|
// Sometimes the docker registry fails and has random timeouts
|
||||||
deleteDir()
|
// this block will retry a doker image 3 times before to fail.
|
||||||
unstash 'source-dependencies'
|
retry(3) {
|
||||||
dir("${BASE_DIR}"){
|
sleep randomNumber(min: 5, max: 10)
|
||||||
// Sometimes the docker registry fails and has random timeouts
|
sh(label: 'Start Elasticsearch', script: './scripts/es-docker.sh --detach')
|
||||||
// this block will retry a doker image 3 times before to fail.
|
|
||||||
retry(3) {
|
|
||||||
sleep randomNumber(min: 5, max: 10)
|
|
||||||
sh(label: 'Start Elasticsearch', script: './scripts/es-docker.sh --detach')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
script {
|
|
||||||
buildDockerImage(fromDockerfile: true).inside('--network=elastic'){
|
|
||||||
dir("${BASE_DIR}"){
|
|
||||||
sh(label: 'Integration test', script: 'npm run test:integration | tee test-integration.tap')
|
|
||||||
sh(label: 'Generating test reporting', script: './node_modules/.bin/tap-mocha-reporter xunit < test-integration.tap > junit-integration.xml')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sh(label: 'Stop Elasticsearch', script: 'docker kill $(docker ps -q)')
|
|
||||||
junit(allowEmptyResults: true, keepLongStdio: true, testResults: "${BASE_DIR}/**/junit-*.xml")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
script {
|
||||||
|
buildDockerImage(fromDockerfile: true).inside('--network=elastic'){
|
||||||
stage('xPack') {
|
|
||||||
agent { label 'docker && immutable' }
|
|
||||||
options { skipDefaultCheckout() }
|
|
||||||
environment {
|
|
||||||
TEST_ES_SERVER = 'https://elastic:changeme@elasticsearch:9200'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
withGithubNotify(context: 'Integration test xPack') {
|
|
||||||
deleteDir()
|
|
||||||
unstash 'source-dependencies'
|
|
||||||
dir("${BASE_DIR}"){
|
dir("${BASE_DIR}"){
|
||||||
// Sometimes the docker registry fails and has random timeouts
|
sh(label: 'Integration test', script: 'npm run test:integration | tee test-integration.tap')
|
||||||
// this block will retry a doker image 3 times before to fail.
|
sh(label: 'Generating test reporting', script: './node_modules/.bin/tap-mocha-reporter xunit < test-integration.tap > junit-integration.xml')
|
||||||
retry(3) {
|
|
||||||
sleep randomNumber(min: 5, max: 10)
|
|
||||||
sh(label: 'Start Elasticsearch', script: './scripts/es-docker-platinum.sh --detach')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
script {
|
|
||||||
buildDockerImage(fromDockerfile: true).inside('--network=elastic'){
|
|
||||||
dir("${BASE_DIR}"){
|
|
||||||
sh(label: 'Integration test', script: 'npm run test:integration | tee test-integration.tap')
|
|
||||||
sh(label: 'Generating test reporting', script: './node_modules/.bin/tap-mocha-reporter xunit < test-integration.tap > junit-integration.xml')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sh(label: 'Stop Elasticsearch', script: 'docker kill $(docker ps -q)')
|
|
||||||
junit(allowEmptyResults: true, keepLongStdio: true, testResults: "${BASE_DIR}/**/junit-*.xml")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sh(label: 'Stop Elasticsearch', script: 'docker kill $(docker ps -q)')
|
||||||
|
junit(allowEmptyResults: true, keepLongStdio: true, testResults: "${BASE_DIR}/**/junit-*.xml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user