mirror of https://github.com/status-im/go-waku.git
ci: add RACE parameter to fix conditional (#648)
We are checking if `JOB_NAME` contains a token `race` to set the default value for `RACE` parameter which decides which tests run. Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
9e6c09e680
commit
d860d825c1
|
@ -18,6 +18,16 @@ pipeline {
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* WARNING: Defining parameters here with the ?: trick causes them to remember last value. */
|
||||||
|
parameters {
|
||||||
|
booleanParam(
|
||||||
|
name: 'RACE',
|
||||||
|
description: 'Run tests with check for race condition.',
|
||||||
|
defaultValue: getRaceDefault()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
TARGET = 'tests'
|
TARGET = 'tests'
|
||||||
REPO = "${env.WORKSPACE}/src/github.com/waku-org/go-waku"
|
REPO = "${env.WORKSPACE}/src/github.com/waku-org/go-waku"
|
||||||
|
@ -40,7 +50,7 @@ pipeline {
|
||||||
|
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
steps { script { dir(env.REPO) {
|
steps { script { dir(env.REPO) {
|
||||||
if (env.JOB_BASE_NAME == "race") {
|
if (params.RACE) {
|
||||||
nix.develop('make test-with-race', pure: false)
|
nix.develop('make test-with-race', pure: false)
|
||||||
}else {
|
}else {
|
||||||
nix.develop('make test-ci', pure: false)
|
nix.develop('make test-ci', pure: false)
|
||||||
|
@ -64,7 +74,7 @@ pipeline {
|
||||||
GANACHE_NETWORK_RPC_URL = "ws://localhost:${env.GANACHE_RPC_PORT}"
|
GANACHE_NETWORK_RPC_URL = "ws://localhost:${env.GANACHE_RPC_PORT}"
|
||||||
}
|
}
|
||||||
steps { script { dir(env.REPO) {
|
steps { script { dir(env.REPO) {
|
||||||
if (env.JOB_BASE_NAME == "race") {
|
if (params.RACE) {
|
||||||
nix.develop('make test-onchain-with-race', pure: false)
|
nix.develop('make test-onchain-with-race', pure: false)
|
||||||
}else {
|
}else {
|
||||||
nix.develop('make test-onchain', pure: false)
|
nix.develop('make test-onchain', pure: false)
|
||||||
|
@ -86,3 +96,7 @@ pipeline {
|
||||||
} }
|
} }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def Boolean getRaceDefault() {
|
||||||
|
return env.JOB_NAME.split('/').contains('race')
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue