Skip to content

Commit

Permalink
Merge pull request #1389 from LiskHQ/1382-cypress-report-to-github
Browse files Browse the repository at this point in the history
Report Cypress results to GitHub - Closes #1382
  • Loading branch information
fchavant committed Oct 25, 2018
2 parents 0a2cdce + 0ab174f commit 7c421e7
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Jenkinsfile
Expand Up @@ -92,10 +92,13 @@ pipeline {
}
},
"cypress": {
githubNotify context: 'Jenkins e2e tests',
description: 'e2e tests in progress...',
status: 'PENDING'
withCredentials([string(credentialsId: 'lisk-hub-testnet-passphrase', variable: 'TESTNET_PASSPHRASE')]) {
ansiColor('xterm') {
wrap([$class: 'Xvfb', parallelBuild: true, autoDisplayName: true]) {
sh '''
sh '''#!/bin/bash -xe
export N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
wget -nv -c https://github.com/LiskHQ/lisk-docker/archive/2.2.0.tar.gz
Expand All @@ -111,7 +114,12 @@ pipeline {
cd -
npm run serve -- $WORKSPACE/app/build -p 300$N -a 127.0.0.1 &>server.log &
npm run cypress:run -- --record
set +e
set -o pipefail
npm run cypress:run -- --record |tee cypress.log
ret=$?
grep --extended-regexp --only-matching 'https://dashboard.cypress.io/#/projects/1it63b/runs/[0-9]+' cypress.log |tail --lines=1 >.cypress
exit $ret
'''
}
}
Expand Down Expand Up @@ -148,12 +156,24 @@ pipeline {
liskSlackSend('good', "Recovery: build ${build_info} was successful.")
}
}
catchError {
githubNotify context: 'Jenkins e2e tests',
description: 'All e2e tests passed.',
status: 'SUCCESS',
targetUrl: readFile(".cypress").trim()
}
}
failure {
script {
build_info = getBuildInfo()
liskSlackSend('danger', "Build ${build_info} failed (<${env.BUILD_URL}/console|console>, <${env.BUILD_URL}/changes|changes>)")
}
catchError {
githubNotify context: 'Jenkins e2e tests',
description: 'Some e2e tests failed.',
status: 'FAILURE',
targetUrl: readFile(".cypress").trim()
}
}
}
}

0 comments on commit 7c421e7

Please sign in to comment.