forked from bcgov/tfrs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-browserstack
50 lines (43 loc) · 1.63 KB
/
Jenkinsfile-browserstack
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
50
result = 0
stage('Test DEV using Browserstack') {
podTemplate(label: "develop-maven-${env.BUILD_NUMBER}", name: "develop-maven-${env.BUILD_NUMBER}", serviceAccount: 'jenkins-basic', cloud: 'openshift',
containers: [
containerTemplate(
name: 'jnlp',
image: 'registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7:v3.9',
resourceRequestCpu: '500m',
resourceLimitCpu: '1000m',
resourceRequestMemory: '1Gi',
resourceLimitMemory: '1Gi',
workingDir: '/home/jenkins',
command: '',
args: '${computer.jnlpmac} ${computer.name}'
)
]
) {
node("develop-maven-${env.BUILD_NUMBER}") {
checkout scm
dir('functional-tests') {
try {
withCredentials([usernamePassword(credentialsId: 'browserstack', usernameVariable: 'BROWSERSTACK_USERNAME', passwordVariable: 'BROWSERSTACK_TOKEN'),
file(credentialsId: 'functional_test_users_v2', variable: 'envfile')]) {
sh "cp \$envfile .env"
sh './gradlew remoteChromeTest --tests specs.CreditTransferSpec'
sh './gradlew remoteFirefoxTest --tests specs.CreditTransferSpec'
sh './gradlew remoteEdgeTest --tests specs.CreditTransferSpec'
}
} catch (Throwable t) {
result = 1
} finally {
//junit 'nosetests.xml'
}
}
} //end of node
} //end of podTemplate
}
echo "result is ${result}"
if (result != 0) {
echo "[FAILURE] Functional Test stage failed"
currentBuild.result = 'FAILURE'
return
}