status-desktop/ci/Jenkinsfile.uitests

147 lines
4.7 KiB
Plaintext

library 'status-jenkins-lib@v1.5.1'
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
pipeline {
agent { label 'linux' }
parameters {
booleanParam(
name: 'RELEASE',
description: 'Decides whether binaries are built with debug symbols.',
defaultValue: params.RELEASE ?: false
)
choice(
name: 'VERBOSE',
description: 'Level of verbosity based on nimbus-build-system setup.',
choices: ['0', '1', '2']
)
}
options {
timestamps()
/* Prevent Jenkins jobs from running forever */
timeout(time: 120, unit: 'MINUTES')
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '10',
daysToKeepStr: '30',
artifactNumToKeepStr: '3',
))
/* Throttle number of concurrent builds. */
throttleJobProperty(
throttleEnabled: true,
throttleOption: 'category',
categories: ['status-desktop-e2e-tests'],
maxConcurrentPerNode: 1,
maxConcurrentTotal: 1
)
/* Abort old PR builds. */
disableConcurrentBuilds(
abortPrevious: isPRBuild
)
}
environment {
TARGET = 'e2e'
/* Improve make performance */
MAKEFLAGS = "-j4 V=${params.VERBOSE}"
/* Disable colors in Nim compiler logs */
NIMFLAGS = '--colors:off'
/* Makefile assumes the compiler folder is included */
QTDIR = "/opt/qt/5.14.2/gcc_64"
/* Control output the filename */
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage')}"
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'tar.gz')}"
/* Include library in order to compile the project */
LD_LIBRARY_PATH = "$QTDIR/lib:$WORKSPACE/vendor/status-go/build/bin:$WORKSPACE/vendor/status-keycard-go/build/libkeycard/"
INFURA_TOKEN = "cd313fedd0dd4699b194d72b5184be06"
}
stages {
stage('Deps') {
steps {
/* trigger fetching of git submodules */
sh 'make check-pkg-target-linux'
/* TODO: Re-add caching of Nim compiler. */
sh 'make deps'
}
}
stage('status-go') {
steps { sh 'make status-go' }
}
stage('build') {
steps { sh 'make' }
}
stage('Tests') {
steps {
script {
def goerli_rpc_port = 855 + env.EXECUTOR_NUMBER
def mnemonic = "pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial"
def goerli_db_path = "$WORKSPACE/test/ui-test/fixtures/ganache-dbs/goerli"
def rpc_port = 864 + env.EXECUTOR_NUMBER
def geth_port = 3131 + env.EXECUTOR_NUMBER
docker.image('trufflesuite/ganache:v7.4.1').withRun(
"-p 127.0.0.1:${goerli_rpc_port}:8545 -v ${goerli_db_path}:/goerli-db",
"-e 10 -m='${mnemonic}' --chain.chainId 5 --database.dbPath /goerli-db"
) { c ->
sh "docker logs ${c.id}"
docker.image('statusteam/status-go:v0.84.0').withRun(
"-p 127.0.0.1:${rpc_port}:8545 -p 127.0.0.1:${geth_port}:30303/tcp -p 127.0.0.1:${geth_port}:30303/udp -v ${env.WORKSPACE}/ci/mailserver/config.json:/config.json",
"-log=INFO -log-without-color -c=/config.json -dir=/tmp"
) { c2 ->
env.PEER_ENR = sh(script:"RPC_PORT=${rpc_port} MAILSERVER_PORT=${geth_port} ${env.WORKSPACE}/ci/mailserver/get_enode.sh", returnStdout:true).trim()
withEnv(["TEST_PEER_ENR=${env.PEER_ENR}", "GOERLI_NETWORK_RPC_URL=http://0.0.0.0:${goerli_rpc_port}"]){
wrap([
$class: 'Xvfb',
autoDisplayName: true,
parallelBuild: true,
screen: '2560x1440x24',
]) {
script {
def res = squish([
extraOptions: '''
--retry
2
--tags
~mayfail
--tags
~merge
--config
addAUT
nim_status_client
${WORKSPACE}/bin
''',
squishPackageName: 'squish-6.7.2-qt514x-linux64',
testSuite: '${WORKSPACE}/test/ui-test/testSuites/*',
])
echo res
if ( res == "SUCCESS" || res == "UNSTABLE" ) {
return
}
throw new Exception("squish test didn't end with success")
}
}
}
}
}
}
}
}
}
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
always { cleanWs() }
}
}