Skip to content

Commit 08bca43

Browse files
committed
ci: create e2e nightly run on ci.status.im
Before removing e2e relaled tasks from ci.infra.status.im - let's have a job on devel Jenkins instance.
1 parent ad17c37 commit 08bca43

File tree

2 files changed

+171
-0
lines changed

2 files changed

+171
-0
lines changed

ci/Jenkinsfile.e2e-nightly

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env groovy
2+
3+
4+
pipeline {
5+
agent { label 'linux' }
6+
7+
triggers {
8+
// Nightly at 4am
9+
cron 'H 4 * * *'
10+
}
11+
12+
parameters {
13+
string(
14+
name: 'BRANCH',
15+
description: 'Name of the branch to checkout and build.',
16+
defaultValue: 'develop',
17+
)
18+
}
19+
20+
options {
21+
timestamps()
22+
disableConcurrentBuilds()
23+
buildDiscarder(logRotator(
24+
numToKeepStr: '10',
25+
daysToKeepStr: '30',
26+
))
27+
}
28+
29+
stages {
30+
stage('Build') {
31+
steps {
32+
script {
33+
apk_build = jenkins.Build('status-mobile/platforms/android-e2e')
34+
apk_build_number = apk_build.getNumber().toString()
35+
}
36+
}
37+
}
38+
stage('Run e2e') {
39+
steps {
40+
build(
41+
job: 'status-mobile/e2e/status-app-nightly',
42+
parameters: [
43+
string(name: 'APK_BUILD_NUMBER', value: apk_build_number),
44+
string(name: 'BRANCH', value: env.BRANCH),
45+
]
46+
)
47+
}
48+
}
49+
}
50+
}
51+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
#!/usr/bin/env groovy
2+
3+
4+
pipeline {
5+
6+
agent { label 'linux' }
7+
8+
parameters {
9+
string(
10+
name: 'APK_BUILD_NUMBER',
11+
description: 'platform/e2e build number for apk artifact',
12+
)
13+
string(
14+
name: 'KEYWORD_EXPRESSION',
15+
description: 'This will run tests which contain names that match the given string expression (Optional)',
16+
defaultValue: '',
17+
)
18+
string(
19+
name: 'BRANCH',
20+
description: 'Name of the branch to checkout and build.',
21+
defaultValue: 'develop',
22+
)
23+
string(
24+
name: 'TR_CASE_IDS',
25+
description: 'IDs of the TestRail case, separated by a comma (Optional)',
26+
defaultValue: '',
27+
)
28+
}
29+
30+
options {
31+
disableConcurrentBuilds()
32+
}
33+
34+
stages {
35+
stage('Fetch') {
36+
steps { script {
37+
copyArtifacts(
38+
projectName: "status-mobile/platforms/android-e2e",
39+
filter: 'result/*-x86.apk',
40+
selector: specific(env.APK_BUILD_NUMBER),
41+
)
42+
apk_path = "${env.WORKSPACE}/${utils.findFile('result/*-x86.apk')}"
43+
44+
} }
45+
}
46+
47+
stage('Setup') {
48+
steps { script {
49+
dir('test/appium') {
50+
sh 'pip3 install --user -r requirements.txt'
51+
}
52+
} }
53+
}
54+
55+
stage('Test') {
56+
steps {
57+
withCredentials([
58+
usernamePassword(
59+
credentialsId: 'test-rail-api',
60+
usernameVariable: 'TESTRAIL_USER',
61+
passwordVariable: 'TESTRAIL_PASS'
62+
),
63+
usernamePassword(
64+
credentialsId: 'sauce-labs-api',
65+
usernameVariable: 'SAUCE_USERNAME',
66+
passwordVariable: 'SAUCE_ACCESS_KEY'
67+
),
68+
string(
69+
credentialsId: 'etherscan-api-key',
70+
variable: 'ETHERSCAN_API_KEY'
71+
),
72+
string(
73+
credentialsId: 'infura-e2e-token',
74+
variable: 'WEB3_INFURA_PROJECT_ID'
75+
),
76+
file(
77+
credentialsId: "mobile-tests-eth-accounts",
78+
variable: 'TEST_ETH_ACCOUNTS_FILE'
79+
),
80+
]) {
81+
dir('test/appium/tests') {
82+
/* Provide Eth test accounts secrets. */
83+
sh 'cp -f $TEST_ETH_ACCOUNTS_FILE users.py'
84+
sh """
85+
python3 -m pytest \
86+
--numprocesses 6 \
87+
--rerun_count=2 \
88+
--testrail_report=True \
89+
-m testrail_id \
90+
-m \"new_ui_critical or new_ui_medium\" \
91+
-k \"${params.KEYWORD_EXPRESSION}\" \
92+
--apk=${params.APK_URL ?: apk_path}
93+
"""
94+
}
95+
}
96+
}
97+
}
98+
}
99+
100+
post {
101+
always {
102+
script {
103+
sauce('sauce-labs-cred') {
104+
saucePublisher()
105+
}
106+
}
107+
}
108+
success {
109+
script {
110+
junit(
111+
testDataPublishers: [[$class: 'SauceOnDemandReportPublisher', jobVisibility: 'public']],
112+
testResults: 'test/appium/tests/*.xml'
113+
)
114+
}
115+
}
116+
cleanup {
117+
sh 'make purge'
118+
}
119+
}
120+
}

0 commit comments

Comments
 (0)