Commit d11d37d6 authored by Christophe Henry's avatar Christophe Henry

Parallelize Jenkins instrumented tests step

parent 3b064ded
Pipeline #3472 failed with stage
in 0 seconds
......@@ -7,8 +7,10 @@ pipeline {
}
environment {
MIN_SDK_IMAGE = "system-images;android-21;default;x86_64"
TARGET_SDK_IMAGE = "system-images;android-28;default;x86_64"
MIN_SDK_VERSION = 21
MAX_SDK_VERSION = 28
MIN_SDK_IMAGE = "system-images;android-$MIN_SDK_VERSION;default;x86_64"
MAX_SDK_IMAGE = "system-images;android-$MAX_SDK_VERSION;default;x86_64"
ANDROID_HOME = "/opt/android-sdk-linux"
}
......@@ -42,7 +44,6 @@ pipeline {
updateGitlabCommitStatus name: "Job", state: "running"
updateGitlabCommitStatus name: "Pre", state: "running"
library "android-pipeline-steps"
sh "apt-get install net-tools"
}
post {
failure {
......@@ -119,40 +120,48 @@ pipeline {
}
}
}
stage("Instrumented tests on min SDK image") {
steps {
updateGitlabCommitStatus name: "Instrumented tests on min SDK image", state: "running"
withAvd(hardwareProfile: "Nexus 5X", systemImage: env.MIN_SDK_IMAGE, headless: true) {
sh "./gradlew clean connectedDebugAndroidTest"
}
}
stage("Instrumented tests") {
parallel {
stage("on min SDK level") {
steps {
sh "echo ${env.MIN_SDK_IMAGE}"
updateGitlabCommitStatus name: "Instrumented tests on target SDK image", state: "running"
withAvd(hardwareProfile: "Nexus 5X", systemImage: env.MIN_SDK_IMAGE, headless: true) {
sh "./gradlew clean connectedDebugAndroidTest"
}
}
post {
failure {
updateGitlabCommitStatus name: "Instrumented tests on min SDK image", state: "failed"
}
success {
updateGitlabCommitStatus name: "Instrumented tests on min SDK image", state: "success"
}
}
}
stage("Instrumented tests on target SDK image") {
steps {
updateGitlabCommitStatus name: "Instrumented tests on target SDK image", state: "running"
withAvd(hardwareProfile: "Nexus 5X", systemImage: env.TARGET_SDK_IMAGE, headless: true) {
sh "./gradlew clean connectedDebugAndroidTest"
post {
failure {
updateGitlabCommitStatus name: "Instrumented tests on min SDK image", state: "failed"
}
success {
updateGitlabCommitStatus name: "Instrumented tests on min SDK image", state: "success"
}
}
}
}
post {
failure {
updateGitlabCommitStatus name: "Instrumented tests on target SDK image", state: "failed"
}
success {
updateGitlabCommitStatus name: "Instrumented tests on target SDK image", state: "success"
stage("on max SDK level") {
steps {
sh "echo ${env.MAX_SDK_IMAGE}"
updateGitlabCommitStatus name: "Instrumented tests on target SDK image", state: "running"
withAvd(hardwareProfile: "Nexus 5X", systemImage: env.MAX_SDK_IMAGE, headless: true) {
sh "./gradlew clean connectedDebugAndroidTest"
}
}
post {
failure {
updateGitlabCommitStatus name: "Instrumented tests on target SDK image", state: "failed"
}
success {
updateGitlabCommitStatus name: "Instrumented tests on target SDK image", state: "success"
}
}
}
}
}
// stage("Build APK") {
// steps {
// withAvd(hardwareProfile: "Nexus 5X", systemImage: env.MIN_SDK_IMAGE, headless: true) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment