e7d591b7bc
* base * Remove mixnet client from libp2p network backend (#572) * Mixnet v1: Remove all mixnet legacies: mixnet crate, mixnode binary, tests, and docker (#573) * Mixnet v1: Skeleton (#570) * Use QUIC for libp2p (#580) * Add Poisson interval function for Mixnet (#575) * Mixnet network backend skeleton (#586) * Libp2p stream read/write (#587) * Emitting packets from mixclient using libp2p stream (#588) * Handle outputs from mixnode using libp2p stream/gossipsub (#589) * Refactor poisson (#590) * Mix client Poisson emission (#591) * Mix node packet handling (#592) * Mix Packet / Fragment logic (#593) * Move FisherYates to `nomos-utils` (#594) * Mixnet topology (#595) * Mix client/node unit tests (#596) * change multiaddr from tcp to udp with quic-v1 (#607) --------- Co-authored-by: Al Liu <scygliu1@gmail.com>
111 lines
2.7 KiB
Groovy
111 lines
2.7 KiB
Groovy
#!/usr/bin/env groovy
|
|
library 'status-jenkins-lib@v1.8.6'
|
|
|
|
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('Integration Tests') {
|
|
matrix {
|
|
axes {
|
|
axis {
|
|
name 'FEATURE'
|
|
values 'libp2p'
|
|
}
|
|
}
|
|
stages {
|
|
stage('Tests') {
|
|
options {
|
|
lock('sync-integration-${env.GIT_COMMIT}')
|
|
}
|
|
stages {
|
|
stage("BuildAndTest") {
|
|
steps {
|
|
script {
|
|
/* To prevent rebuilding node for each test, tests are defined here */
|
|
def tests = ['ten_nodes_happy', 'two_nodes_happy', 'ten_nodes_one_down']
|
|
|
|
def report = runBuildAndTestsForFeature(FEATURE, tests)
|
|
writeFile(file: "${WORKSPACE}/report.txt", text: report)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
always { script {
|
|
def report = readFile("${WORKSPACE}/report.txt").trim()
|
|
discord.send(
|
|
header: "Nightly Integration Tests ${currentBuild.currentResult}: ${report}",
|
|
cred: 'nomos-node-discord-commits-webhook',
|
|
)
|
|
} }
|
|
cleanup { cleanWs() }
|
|
}
|
|
}
|
|
|
|
def runBuildAndTestsForFeature(feature, tests) {
|
|
echo "Building node for feature: ${feature}"
|
|
def build_node = "cargo build --all --no-default-features --features ${feature}"
|
|
|
|
if (sh(script: build_node, returnStatus: true) != 0) {
|
|
return reportError("Build '${feature}' node failed")
|
|
}
|
|
|
|
int iterations = params.ITERATIONS.toInteger()
|
|
return runTestCases(tests, iterations)
|
|
}
|
|
|
|
def runTestCases(test_cases, iterations) {
|
|
for (int i = 0; i < iterations; i++) {
|
|
echo "Running iteration ${i + 1} of ${iterations}"
|
|
|
|
for (test_case in test_cases) {
|
|
def test_cmd = "cargo test -p tests --all --no-default-features --features ${feature} ${test_case}"
|
|
if (sh(script: test_cmd, returnStatus: true) != 0) {
|
|
return reportError("Test '${test_case}' failed on iteration ${i + 1}")
|
|
}
|
|
}
|
|
}
|
|
|
|
return "${iterations}/${iterations} iterations succeeded"
|
|
}
|
|
|
|
def reportError(e) {
|
|
error(e)
|
|
return e
|
|
}
|