Skip to content

Commit

Permalink
chore_: start nwaku in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed May 29, 2024
1 parent 72ac2dc commit 38c06bd
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions _assets/ci/Jenkinsfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ pipeline {
PLATFORM = 'tests'
DB_CONT = "status-go-test-db-${env.EXECUTOR_NUMBER.toInteger() + 1}"
DB_PORT = "${5432 + env.EXECUTOR_NUMBER.toInteger()}"
NWAKU1_CONT = "status-go-nwaku-${env.EXECUTOR_NUMBER.toInteger() + 1}"
NWAKU1_PORT = "${60000 + env.EXECUTOR_NUMBER.toInteger()}"
NWAKU1_REST_PORT = "${40000 + env.EXECUTOR_NUMBER.toInteger()}"
NWAKU2_CONT = "status-go-nwaku-${env.EXECUTOR_NUMBER.toInteger() + 2}"
NWAKU2_PORT = "${61000 + env.EXECUTOR_NUMBER.toInteger()}"
NWAKU2_REST_PORT = "${41000 + env.EXECUTOR_NUMBER.toInteger()}"
TMPDIR = "${WORKSPACE_TMP}"
GOPATH = "${WORKSPACE_TMP}/go"
GOCACHE = "${WORKSPACE_TMP}/gocache"
Expand Down Expand Up @@ -116,26 +122,38 @@ pipeline {
stage('Unit Tests') {
environment {
TEST_POSTGRES_PORT = "${env.DB_PORT}"

}
steps { script {
db = docker.image('postgres:9.6-alpine').withRun([
"--name=${DB_CONT}",
"--env=POSTGRES_HOST_AUTH_METHOD=trust",
"--publish=${DB_PORT}:${DB_PORT}",
].join(' '), "-p ${DB_PORT}") { c ->
nix.shell('make generate-handlers', pure: true)
withCredentials([
string(
credentialsId: 'codeclimate-test-reporter-id',
variable: 'CC_TEST_REPORTER_ID'
),
]) {
nix.shell('make test-unit V=1', pure: false)
}

nwaku1 = docker.image('harbor.status.im/wakuorg/nwaku:v0.28.0').withRun([
"--name=${NWAKU1_CONT}",
"--publish=${NWAKU1_PORT}:${NWAKU1_PORT}",
].join(' '), "-p ${NWAKU1_PORT} --store --rest-port=${NWAKU_REST_PORT} --nodekey=1122334455667788990011223344556677889900112233445566778899001122") { n1 ->

nix.shell('make generate-handlers', pure: true)
withCredentials([
string(
credentialsId: 'codeclimate-test-reporter-id',
variable: 'CC_TEST_REPORTER_ID'
),
]) {
nix.shell('make test-unit V=1', pure: false)
}
}


}
} }
post { cleanup { /* Leftover DB containers. */
sh "docker rm ${DB_CONT} || true"
sh "docker rm ${NWAKU1_CONT} || true"

} }
}
} // stages
Expand Down

0 comments on commit 38c06bd

Please sign in to comment.