forked from Catrobat/Catroid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.SensorboxTests
49 lines (46 loc) · 1.97 KB
/
Jenkinsfile.SensorboxTests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!groovy
pipeline {
agent {
dockerfile {
filename 'Dockerfile.jenkins'
// 'docker build' would normally copy the whole build-dir to the container, changing the
// docker build directory avoids that overhead
dir 'docker'
// Pass the uid and the gid of the current user (jenkins-user) to the Dockerfile, so a
// corresponding user can be added. This is needed to provide the jenkins user inside
// the container for the ssh-agent to work.
// Another way would be to simply map the passwd file, but would spoil additional information
// Also hand in the group id of kvm to allow using /dev/kvm.
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --build-arg KVM_GROUP_ID=$(getent group kvm | cut -d: -f3)'
args '--net host -v /dev/bus/usb/:/dev/bus/usb -v /var/local/container_shared/gradle_cache/$EXECUTOR_NUMBER:/home/user/.gradle'
// run on slave1 where nexus is connected to
label 'HardwareSensorBox'
}
}
options {
timeout(time: 2, unit: 'HOURS')
timestamps()
}
stages {
stage('Unit and Device tests') {
steps {
lock(resource: null, label: "HardwareSensorBox-${env.NODE_NAME}", quantity: 1, variable: 'ANDROID_SERIAL') {
sh './gradlew -Pandroid.testInstrumentationRunnerArguments.class=org.catrobat.catroid.testsuites.UiEspressoSensorboxTestSuite connectedCatroidDebugAndroidTest'
}
}
post {
always {
junit '**/*TEST*.xml'
}
}
}
}
post {
always {
step([$class: 'LogParserPublisher', failBuildOnError: true, projectRulePath: 'buildScripts/log_parser_rules', unstableOnWarning: true, useProjectRule: true])
}
changed {
notifyChat()
}
}
}