2023-07-06 13:30:43 +00:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
dockerfile {
|
|
|
|
label 'linux'
|
|
|
|
dir 'ci'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
string(
|
|
|
|
name: 'ITERATIONS',
|
|
|
|
description: 'Number of repeated integration test runs',
|
|
|
|
defaultValue: params.ITERATIONS ?: '1000'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
/* Avoid cache poisoning by other jobs. */
|
|
|
|
GOCACHE = "${env.WORKSPACE_TMP}/go-build"
|
|
|
|
GOPATH = "${env.WORKSPACE_TMP}/go"
|
|
|
|
RUST_BACKTRACE = 1
|
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '20',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
/* Node binary is required for integration tests */
|
|
|
|
sh 'cargo build'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Integration tests') {
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
int iterations = params.ITERATIONS.toInteger()
|
|
|
|
|
|
|
|
for (int i = 0; i < iterations; i++) {
|
|
|
|
echo "Running iteration ${i + 1} of ${iterations}"
|
|
|
|
|
2023-07-17 18:16:05 +00:00
|
|
|
if (sh(script: 'cargo test ten_nodes_happy', returnStatus: true) != 0) {
|
|
|
|
error("Test failed on iteration ${i + 1}")
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sh(script: 'cargo test two_nodes_happy', returnStatus: true) != 0) {
|
|
|
|
error("Test failed on iteration ${i + 1}")
|
|
|
|
break
|
|
|
|
}
|
2023-07-06 13:30:43 +00:00
|
|
|
|
2023-07-17 18:16:05 +00:00
|
|
|
if (sh(script: 'cargo test ten_nodes_one_down', returnStatus: true) != 0) {
|
2023-07-06 13:30:43 +00:00
|
|
|
error("Test failed on iteration ${i + 1}")
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-17 18:16:05 +00:00
|
|
|
|
2023-07-06 13:30:43 +00:00
|
|
|
post {
|
|
|
|
failure {
|
|
|
|
script {
|
|
|
|
def discord = load "${WORKSPACE}/ci/discord.groovy"
|
|
|
|
discord.sendMessage(header: 'Nightly Integration Tests Failed')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
success {
|
|
|
|
script {
|
|
|
|
def discord = load "${WORKSPACE}/ci/discord.groovy"
|
|
|
|
discord.sendMessage(header: 'Nightly Integration Tests Passed')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|