From 1f91bbc7247e1f7e0a811c6246d7bbbe470e8c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 7 Apr 2023 16:17:30 +0200 Subject: [PATCH] ci: fix typo in arch, add tests prefix to names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The symlinks are temporary to avoid issues in PRs that won't be rebased right away. We can remove them later. Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.combined | 2 +- ci/Jenkinsfile.e2e | 186 +---------------------------------- ci/Jenkinsfile.imports | 70 +------------ ci/Jenkinsfile.linux | 2 +- ci/Jenkinsfile.macos | 2 +- ci/Jenkinsfile.tests-e2e | 185 ++++++++++++++++++++++++++++++++++ ci/Jenkinsfile.tests-imports | 69 +++++++++++++ ci/Jenkinsfile.tests-nim | 2 +- ci/Jenkinsfile.windows | 2 +- 9 files changed, 261 insertions(+), 259 deletions(-) mode change 100644 => 120000 ci/Jenkinsfile.e2e mode change 100644 => 120000 ci/Jenkinsfile.imports create mode 100644 ci/Jenkinsfile.tests-e2e create mode 100644 ci/Jenkinsfile.tests-imports diff --git a/ci/Jenkinsfile.combined b/ci/Jenkinsfile.combined index 5a1c1ea3f1..b688948891 100644 --- a/ci/Jenkinsfile.combined +++ b/ci/Jenkinsfile.combined @@ -36,7 +36,7 @@ pipeline { stage('MacOS/x86_64') { steps { script { macos_x86_64 = jenkins.Build('status-desktop/platforms/macos/x86_64') } } } - stage('MacOS/arch64') { steps { script { + stage('MacOS/aarch64') { steps { script { macos_aarch64 = jenkins.Build('status-desktop/platforms/macos/aarch64') } } } } diff --git a/ci/Jenkinsfile.e2e b/ci/Jenkinsfile.e2e deleted file mode 100644 index 98822c314a..0000000000 --- a/ci/Jenkinsfile.e2e +++ /dev/null @@ -1,185 +0,0 @@ -library 'status-jenkins-lib@v1.6.8' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { - label 'linux && x86_64 && qt-5.15.2' - } - - 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', - maxConcurrentPerNode: 1, - maxConcurrentTotal: 10 - ) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'linux-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.15.2/gcc_64' - PATH = "${env.QTDIR}/bin:${env.PATH}" - /* Include library in order to compile the project */ - LD_LIBRARY_PATH = "$QTDIR/lib:$WORKSPACE/vendor/DOtherSide/build/qzxing:$WORKSPACE/vendor/status-go/build/bin:$WORKSPACE/vendor/status-keycard-go/build/libkeycard/" - /* Container ports */ - RPC_PORT = "${8545 + env.EXECUTOR_NUMBER.toInteger()}" - P2P_PORT = "${6010 + env.EXECUTOR_NUMBER.toInteger()}" - /* Ganache config */ - GANACHE_RPC_PORT = "${9545 + env.EXECUTOR_NUMBER.toInteger()}" - GANACHE_MNEMONIC = 'pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial' - TEST_ENVIRONMENT = '1' - } - - stages { - stage('Deps') { - steps { - sh 'make update' - sh 'make deps' - } - } - - stage('status-go') { - steps { - sh 'make status-go' - } - } - - stage('build') { - environment { - GANACHE_NETWORK_RPC_URL = "http://localhost:${env.GANACHE_RPC_PORT}" - } - steps { - sh 'make' - } - } - - stage('Containers') { - parallel { - stage('Ganache') { steps { script { - ganache = docker.image( - 'trufflesuite/ganache:v7.4.1' - ).run( - ["-p 127.0.0.1:${env.GANACHE_RPC_PORT}:8545", - "-v ${env.WORKSPACE}/test/ui-test/fixtures/ganache-dbs/goerli:/goerli-db"].join(' '), - ["-m='${GANACHE_MNEMONIC}'", "-e=10", - '--chain.chainId=5', - '--database.dbPath=/goerli-db'].join(' ') - ) - } } } - - stage('Nim-Waku') { steps { script { - nimwaku = docker.image( - 'statusteam/nim-waku:v0.13.0' - ).run( - ["-p 127.0.0.1:${env.RPC_PORT}:8545", - "-p 127.0.0.1:${env.P2P_PORT}:30303/tcp", - "-p 127.0.0.1:${env.P2P_PORT}:30303/udp", - "-v ${env.WORKSPACE}/ci/mailserver/config.json:/config.json"].join(' '), - ['--store=true', - '--keep-alive=true', - '--rpc-address=0.0.0.0', - '--nat=none'].join(' ') - ) - env.TEST_PEER_ENR = getPeerAddress() - } } } - } - } - - stage('Tests') { - options { - throttle(categories: ['status-desktop-e2e-tests']) - } - steps { script { - wrap([ - $class: 'Xvfb', - autoDisplayName: true, - parallelBuild: true, - screen: '2560x1440x24', - ]) { script { - def result = squish([ - extraOptions: [ - '--retry', '2', - '--tags', '~mayfail', - '--tags', '~merge', - '--tags', '~relyon-mailserver', - '--config', 'addAUT', 'nim_status_client', - "${WORKSPACE}/bin", - ].join('\n'), - squishPackageName: 'squish-7.1-20230222-1555-qt515x-linux64', - testSuite: "${WORKSPACE}/test/ui-test/testSuites/*", - ]) - print("Squish run result: ${result}") - if (!['SUCCESS'].contains(result)) { - throw new Exception('Squish run failed!') - } - } } - } } - post { - failure { script { - sh("docker logs ${nimwaku.id}") - sh("docker logs ${ganache.id}") - } } - } - } - } - - post { - success { script { - github.notifyPR(true) - } } - failure { script { - github.notifyPR(false) - } } - always { script { /* No artifact but a PKG_URL is necessary. */ - env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" - } } - cleanup { script { - sh './scripts/clean-git.sh' - if (binding.hasVariable('ganache')) { ganache.stop() } - if (binding.hasVariable('nimwaku')) { nimwaku.stop() } - } } - } -} - -def getPeerAddress() { - def rpcResp = sh( - script: "${env.WORKSPACE}/scripts/rpc.sh get_waku_v2_debug_v1_info", - returnStdout: true - ).trim() - assert rpcResp : 'Could not get node address from RPC API!' - return readJSON(text: rpcResp)['result']['listenAddresses'][0] -} diff --git a/ci/Jenkinsfile.e2e b/ci/Jenkinsfile.e2e new file mode 120000 index 0000000000..34eeb46c00 --- /dev/null +++ b/ci/Jenkinsfile.e2e @@ -0,0 +1 @@ +Jenkinsfile.tests-e2e \ No newline at end of file diff --git a/ci/Jenkinsfile.imports b/ci/Jenkinsfile.imports deleted file mode 100644 index 13c7d2f4a4..0000000000 --- a/ci/Jenkinsfile.imports +++ /dev/null @@ -1,69 +0,0 @@ -library 'status-jenkins-lib@v1.6.8' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { - label 'linux && x86_64 && qt-5.15.2' - } - - parameters { - 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', - )) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'imports' - /* 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.15.2/gcc_64" - PATH = "${env.QTDIR}/bin:${env.PATH}" - /* 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/" - } - - stages { - stage('Build') { - steps { sh 'make statusq-sanity-checker' } - } - - stage('Check') { - steps { sh 'make run-statusq-sanity-checker' } - } - - stage('Upload') { - steps { script { - env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" - } } - } - } - - post { - success { script { github.notifyPR(true) } } - failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } - } -} diff --git a/ci/Jenkinsfile.imports b/ci/Jenkinsfile.imports new file mode 120000 index 0000000000..b9a295f4df --- /dev/null +++ b/ci/Jenkinsfile.imports @@ -0,0 +1 @@ +Jenkinsfile.tests-imports \ No newline at end of file diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index 7ff82b3a85..3316232384 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -43,7 +43,7 @@ pipeline { } environment { - TARGET = "linux-${getArch()}" + TARGET = "linux/${getArch()}" /* Improve make performance */ MAKEFLAGS = "-j4 V=${params.VERBOSE}" /* Disable colors in Nim compiler logs */ diff --git a/ci/Jenkinsfile.macos b/ci/Jenkinsfile.macos index 88cef531ee..3693916592 100644 --- a/ci/Jenkinsfile.macos +++ b/ci/Jenkinsfile.macos @@ -39,7 +39,7 @@ pipeline { } environment { - TARGET = "macos-${getArch()}" + TARGET = "macos/${getArch()}" /* Improve make performance */ MAKEFLAGS = "-j4 V=${params.VERBOSE}" /* Disable colors in Nim compiler logs */ diff --git a/ci/Jenkinsfile.tests-e2e b/ci/Jenkinsfile.tests-e2e new file mode 100644 index 0000000000..8abe951d3f --- /dev/null +++ b/ci/Jenkinsfile.tests-e2e @@ -0,0 +1,185 @@ +library 'status-jenkins-lib@v1.6.8' + +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + +pipeline { + agent { + label 'linux && x86_64 && qt-5.15.2' + } + + 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', + maxConcurrentPerNode: 1, + maxConcurrentTotal: 10 + ) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) + } + + environment { + TARGET = 'tests/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.15.2/gcc_64' + PATH = "${env.QTDIR}/bin:${env.PATH}" + /* Include library in order to compile the project */ + LD_LIBRARY_PATH = "$QTDIR/lib:$WORKSPACE/vendor/DOtherSide/build/qzxing:$WORKSPACE/vendor/status-go/build/bin:$WORKSPACE/vendor/status-keycard-go/build/libkeycard/" + /* Container ports */ + RPC_PORT = "${8545 + env.EXECUTOR_NUMBER.toInteger()}" + P2P_PORT = "${6010 + env.EXECUTOR_NUMBER.toInteger()}" + /* Ganache config */ + GANACHE_RPC_PORT = "${9545 + env.EXECUTOR_NUMBER.toInteger()}" + GANACHE_MNEMONIC = 'pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial' + TEST_ENVIRONMENT = '1' + } + + stages { + stage('Deps') { + steps { + sh 'make update' + sh 'make deps' + } + } + + stage('status-go') { + steps { + sh 'make status-go' + } + } + + stage('build') { + environment { + GANACHE_NETWORK_RPC_URL = "http://localhost:${env.GANACHE_RPC_PORT}" + } + steps { + sh 'make' + } + } + + stage('Containers') { + parallel { + stage('Ganache') { steps { script { + ganache = docker.image( + 'trufflesuite/ganache:v7.4.1' + ).run( + ["-p 127.0.0.1:${env.GANACHE_RPC_PORT}:8545", + "-v ${env.WORKSPACE}/test/ui-test/fixtures/ganache-dbs/goerli:/goerli-db"].join(' '), + ["-m='${GANACHE_MNEMONIC}'", "-e=10", + '--chain.chainId=5', + '--database.dbPath=/goerli-db'].join(' ') + ) + } } } + + stage('Nim-Waku') { steps { script { + nimwaku = docker.image( + 'statusteam/nim-waku:v0.13.0' + ).run( + ["-p 127.0.0.1:${env.RPC_PORT}:8545", + "-p 127.0.0.1:${env.P2P_PORT}:30303/tcp", + "-p 127.0.0.1:${env.P2P_PORT}:30303/udp", + "-v ${env.WORKSPACE}/ci/mailserver/config.json:/config.json"].join(' '), + ['--store=true', + '--keep-alive=true', + '--rpc-address=0.0.0.0', + '--nat=none'].join(' ') + ) + env.TEST_PEER_ENR = getPeerAddress() + } } } + } + } + + stage('Tests') { + options { + throttle(categories: ['status-desktop-e2e-tests']) + } + steps { script { + wrap([ + $class: 'Xvfb', + autoDisplayName: true, + parallelBuild: true, + screen: '2560x1440x24', + ]) { script { + def result = squish([ + extraOptions: [ + '--retry', '2', + '--tags', '~mayfail', + '--tags', '~merge', + '--tags', '~relyon-mailserver', + '--config', 'addAUT', 'nim_status_client', + "${WORKSPACE}/bin", + ].join('\n'), + squishPackageName: 'squish-7.1-20230222-1555-qt515x-linux64', + testSuite: "${WORKSPACE}/test/ui-test/testSuites/*", + ]) + print("Squish run result: ${result}") + if (!['SUCCESS'].contains(result)) { + throw new Exception('Squish run failed!') + } + } } + } } + post { + failure { script { + sh("docker logs ${nimwaku.id}") + sh("docker logs ${ganache.id}") + } } + } + } + } + + post { + success { script { + github.notifyPR(true) + } } + failure { script { + github.notifyPR(false) + } } + always { script { /* No artifact but a PKG_URL is necessary. */ + env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" + } } + cleanup { script { + sh './scripts/clean-git.sh' + if (binding.hasVariable('ganache')) { ganache.stop() } + if (binding.hasVariable('nimwaku')) { nimwaku.stop() } + } } + } +} + +def getPeerAddress() { + def rpcResp = sh( + script: "${env.WORKSPACE}/scripts/rpc.sh get_waku_v2_debug_v1_info", + returnStdout: true + ).trim() + assert rpcResp : 'Could not get node address from RPC API!' + return readJSON(text: rpcResp)['result']['listenAddresses'][0] +} diff --git a/ci/Jenkinsfile.tests-imports b/ci/Jenkinsfile.tests-imports new file mode 100644 index 0000000000..901021c99a --- /dev/null +++ b/ci/Jenkinsfile.tests-imports @@ -0,0 +1,69 @@ +library 'status-jenkins-lib@v1.6.8' + +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + +pipeline { + agent { + label 'linux && x86_64 && qt-5.15.2' + } + + parameters { + 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', + )) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) + } + + environment { + TARGET = 'tests/imports' + /* 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.15.2/gcc_64" + PATH = "${env.QTDIR}/bin:${env.PATH}" + /* 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/" + } + + stages { + stage('Build') { + steps { sh 'make statusq-sanity-checker' } + } + + stage('Check') { + steps { sh 'make run-statusq-sanity-checker' } + } + + stage('Upload') { + steps { script { + env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" + } } + } + } + + post { + success { script { github.notifyPR(true) } } + failure { script { github.notifyPR(false) } } + cleanup { cleanWs() } + } +} diff --git a/ci/Jenkinsfile.tests-nim b/ci/Jenkinsfile.tests-nim index cbf304ece0..9d259feedf 100644 --- a/ci/Jenkinsfile.tests-nim +++ b/ci/Jenkinsfile.tests-nim @@ -36,7 +36,7 @@ pipeline { } environment { - TARGET = 'tests-nim' + TARGET = 'tests/nim' /* Improve make performance */ MAKEFLAGS = "-j4 V=${params.VERBOSE}" /* Disable colors in Nim compiler logs */ diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows index 2d702a50cf..98049a3dd1 100644 --- a/ci/Jenkinsfile.windows +++ b/ci/Jenkinsfile.windows @@ -36,7 +36,7 @@ pipeline { } environment { - TARGET = "windows-${getArch()}" + TARGET = "windows/${getArch()}" /* Improve make performance */ MAKEFLAGS = "-j${utils.getProcCount()} V=${params.VERBOSE}" /* Disable colors in Nim compiler logs */