From cbe50f557c4ce76e75d7170e64323ca1c8814bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 25 Feb 2019 18:48:44 +0100 Subject: [PATCH] move running tests to a separate jenkins job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- _assets/ci/Jenkinsfile.android | 4 -- _assets/ci/Jenkinsfile.ios | 4 -- _assets/ci/Jenkinsfile.linux | 4 -- _assets/ci/Jenkinsfile.tests | 69 ++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 _assets/ci/Jenkinsfile.tests diff --git a/_assets/ci/Jenkinsfile.android b/_assets/ci/Jenkinsfile.android index a9f9df6f2..a544e6fcf 100644 --- a/_assets/ci/Jenkinsfile.android +++ b/_assets/ci/Jenkinsfile.android @@ -57,10 +57,6 @@ pipeline { sh 'make setup-build' } } } - stage('Test') { steps { dir(env.STATUS_PATH) { - sh 'make ci' - } } } - stage('Compile') { steps { dir(env.STATUS_PATH) { sh 'make statusgo-android' sh "cp build/bin/statusgo.aar ${dest}/${artifact}" diff --git a/_assets/ci/Jenkinsfile.ios b/_assets/ci/Jenkinsfile.ios index 48a8ccc9c..e8cf8ecdd 100644 --- a/_assets/ci/Jenkinsfile.ios +++ b/_assets/ci/Jenkinsfile.ios @@ -52,10 +52,6 @@ pipeline { sh 'make setup-build' } } } - stage('Test') { steps { dir(env.STATUS_PATH) { - sh 'make ci' - } } } - stage('Compile') { steps { dir(env.STATUS_PATH) { sh 'make statusgo-ios' dir('build/bin') { diff --git a/_assets/ci/Jenkinsfile.linux b/_assets/ci/Jenkinsfile.linux index 95500a561..8a443980d 100644 --- a/_assets/ci/Jenkinsfile.linux +++ b/_assets/ci/Jenkinsfile.linux @@ -52,10 +52,6 @@ pipeline { sh 'make setup-build' } } } - stage('Test') { steps { dir(env.STATUS_PATH) { - sh 'make ci' - } } } - stage('Compress') { steps { dir(env.STATUS_PATH) { sh "zip -q -r ${dest}/${artifact} . -x *.git" } } } diff --git a/_assets/ci/Jenkinsfile.tests b/_assets/ci/Jenkinsfile.tests new file mode 100644 index 000000000..47637899c --- /dev/null +++ b/_assets/ci/Jenkinsfile.tests @@ -0,0 +1,69 @@ +pipeline { + agent { label 'linux' } + + parameters { + string( + name: 'BRANCH', + defaultValue: 'develop', + description: 'Name of branch to build.' + ) + } + + options { + timestamps() + disableConcurrentBuilds() + /* Go requires a certain directory structure */ + checkoutToSubdirectory('src/github.com/status-im/status-go') + /* manage how many builds we keep */ + buildDiscarder(logRotator( + numToKeepStr: '30', + daysToKeepStr: '30', + )) + } + + environment { + BUILD_PLATFORM = 'linux' + STATUS_PATH = 'src/github.com/status-im/status-go' + CI_DIR = "${env.STATUS_PATH}/_assets/ci" + GOPATH = "${env.WORKSPACE}" + PATH = "${env.PATH}:${env.GOPATH}/bin" + } + + stages { + stage('Prep') { steps { script { + lib = load("${env.STATUS_PATH}/_assets/ci/lib.groovy") + /* clarify what we're building */ + println("Version: ${lib.getVersion()}") + println("Git Branch: ${lib.gitBranch()}") + println("Git Commit: ${lib.gitCommit()}") + } } } + + stage('Setup') { steps { dir(env.STATUS_PATH) { + sh 'make setup-build' + } } } + + stage('Lint') { steps { dir(env.STATUS_PATH) { + sh 'make lint' + } } } + + stage('Mock') { steps { dir(env.STATUS_PATH) { + sh 'make mock' + } } } + + stage('Dep-Ensure') { steps { dir(env.STATUS_PATH) { + sh 'make dep-ensure' + } } } + + stage('Canary') { steps { dir(env.STATUS_PATH) { + sh 'make canary-test' + } } } + + stage('Unit Tests') { steps { dir(env.STATUS_PATH) { + sh 'make test-unit' + } } } + + stage('Race E2E Tests') { steps { dir(env.STATUS_PATH) { + sh 'make test-e2e-race' + } } } + } // stages +} // pipeline