Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

Commit a33776f

Browse files
committed
ci: add Discord notifiction on failure
Depends on: status-im/status-jenkins-lib#83 Signed-off-by: Jakub Sokołowski <jakub@status.im>
1 parent 0628833 commit a33776f

File tree

1 file changed

+102
-86
lines changed

1 file changed

+102
-86
lines changed

ci/Jenkinsfile

Lines changed: 102 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library 'status-jenkins-lib@v1.8.1'
2+
library 'status-jenkins-lib@add-discord-lib'
33

44
pipeline {
55

@@ -28,7 +28,7 @@ pipeline {
2828
string(
2929
name: 'TEST_NAME',
3030
description: 'Paste test name/part of test name to run specific test.',
31-
defaultValue: ''
31+
defaultValue: 'settings_sign_out_and_quit'
3232
)
3333
string(
3434
name: 'TEST_SCOPE_FLAG',
@@ -82,99 +82,115 @@ pipeline {
8282
stages {
8383
stage('Prep') {
8484
steps { script {
85+
test.test()
86+
Discord.notify(
87+
header: 'Desktop E2E test failure!',
88+
cred: 'discord-status-desktop-e2e-webhook',
89+
)
8590
setNewBuildName()
8691
updateGitHubStatus()
8792
} }
8893
}
8994

90-
stage('Deps') {
91-
steps { script {
92-
sh 'pip3 install --user -r requirements.txt'
93-
} }
94-
}
95-
96-
stage('Download') {
97-
when { expression { params.BUILD_SOURCE.startsWith('http') } }
98-
steps { timeout(5) { script {
99-
sh 'mkdir -p ./pkg/'
100-
setBuildDescFromFile(params.BUILD_SOURCE)
101-
fileOperations([
102-
fileDownloadOperation(
103-
url: params.BUILD_SOURCE,
104-
targetFileName: 'StatusIm-Desktop.tar.gz',
105-
targetLocation: './pkg/',
106-
userName: '',
107-
password: '',
108-
)
109-
])
110-
} } }
111-
}
112-
113-
stage('Copy') {
114-
when { expression { ! params.BUILD_SOURCE.startsWith('http') } }
115-
steps { timeout(5) { script {
116-
copyArtifacts(
117-
projectName: params.BUILD_SOURCE,
118-
filter: 'pkg/*-x86_64.tar.gz',
119-
selector: lastWithArtifacts(),
120-
target: './'
121-
)
122-
setBuildDescFromFile(utils.findFile('pkg/*tar.gz'))
123-
} } }
124-
}
125-
126-
stage('Unpack') {
127-
steps { timeout(5) { script {
128-
sh 'mkdir aut'
129-
sh "tar -zxvf '${utils.findFile('pkg/*tar.gz')}' -C './aut'"
130-
env.AUT_PATH = utils.findFile('aut/*.AppImage')
131-
} } }
132-
}
133-
134-
stage('Test') {
135-
steps { timeout(90) { script {
136-
def flags = []
137-
if (params.TEST_NAME) { flags.add("-k=${params.TEST_NAME}") }
138-
if (params.TEST_SCOPE_FLAG) { flags.add(params.TEST_SCOPE_FLAG) }
139-
if (params.LOG_LEVEL) { flags.addAll(["--log-level=${params.LOG_LEVEL}", "--log-cli-level=${params.LOG_LEVEL}"]) }
140-
dir ('configs') { sh 'ln -s _local.ci.py _local.py' }
141-
wrap([
142-
$class: 'Xvfb',
143-
autoDisplayName: true,
144-
parallelBuild: true,
145-
screen: '1920x1080x24',
146-
additionalOptions: '-dpi 1'
147-
]) {
148-
sh 'fluxbox &'
149-
withCredentials([
150-
usernamePassword(
151-
credentialsId: 'test-rail-api-devops',
152-
usernameVariable: 'TESTRAIL_USR',
153-
passwordVariable: 'TESTRAIL_PSW'
154-
)
155-
]) {
156-
sh """
157-
python3 -m pytest ${flags.join(" ")} \
158-
--ignore-flaky \
159-
--disable-warnings \
160-
--alluredir=./allure-results
161-
"""
162-
}
163-
}
164-
} } }
165-
}
95+
//stage('Deps') {
96+
// steps { script {
97+
// sh 'pip3 install --user -r requirements.txt'
98+
// } }
99+
//}
100+
101+
//stage('Download') {
102+
// when { expression { params.BUILD_SOURCE.startsWith('http') } }
103+
// steps { timeout(5) { script {
104+
// sh 'mkdir -p ./pkg/'
105+
// setBuildDescFromFile(params.BUILD_SOURCE)
106+
// fileOperations([
107+
// fileDownloadOperation(
108+
// url: params.BUILD_SOURCE,
109+
// targetFileName: 'StatusIm-Desktop.tar.gz',
110+
// targetLocation: './pkg/',
111+
// userName: '',
112+
// password: '',
113+
// )
114+
// ])
115+
// } } }
116+
//}
117+
118+
//stage('Copy') {
119+
// when { expression { ! params.BUILD_SOURCE.startsWith('http') } }
120+
// steps { timeout(5) { script {
121+
// copyArtifacts(
122+
// projectName: params.BUILD_SOURCE,
123+
// filter: 'pkg/*-x86_64.tar.gz',
124+
// selector: lastWithArtifacts(),
125+
// target: './'
126+
// )
127+
// setBuildDescFromFile(utils.findFile('pkg/*tar.gz'))
128+
// } } }
129+
//}
130+
131+
//stage('Unpack') {
132+
// steps { timeout(5) { script {
133+
// sh 'mkdir aut'
134+
// sh "tar -zxvf '${utils.findFile('pkg/*tar.gz')}' -C './aut'"
135+
// env.AUT_PATH = utils.findFile('aut/*.AppImage')
136+
// } } }
137+
//}
138+
139+
//stage('Test') {
140+
// steps { timeout(90) { script {
141+
// def flags = []
142+
// if (params.TEST_NAME) { flags.add("-k=${params.TEST_NAME}") }
143+
// if (params.TEST_SCOPE_FLAG) { flags.add(params.TEST_SCOPE_FLAG) }
144+
// if (params.LOG_LEVEL) { flags.addAll(["--log-level=${params.LOG_LEVEL}", "--log-cli-level=${params.LOG_LEVEL}"]) }
145+
// dir ('configs') { sh 'ln -s _local.ci.py _local.py' }
146+
// wrap([
147+
// $class: 'Xvfb',
148+
// autoDisplayName: true,
149+
// parallelBuild: true,
150+
// screen: '1920x1080x24',
151+
// additionalOptions: '-dpi 1'
152+
// ]) {
153+
// sh 'fluxbox &'
154+
// withCredentials([
155+
// usernamePassword(
156+
// credentialsId: 'test-rail-api-devops',
157+
// usernameVariable: 'TESTRAIL_USR',
158+
// passwordVariable: 'TESTRAIL_PSW'
159+
// )
160+
// ]) {
161+
// sh """
162+
// python3 -m pytest ${flags.join(" ")} \
163+
// --ignore-flaky \
164+
// --disable-warnings \
165+
// --alluredir=./allure-results
166+
// """
167+
// }
168+
// }
169+
// } } }
170+
//}
166171
}
167172
post {
168173
always { script {
169-
archiveArtifacts('aut/*.log')
170-
allure([
171-
results: [[path: 'allure-results']],
172-
reportBuildPolicy: 'ALWAYS',
173-
properties: [],
174-
jdk: '',
175-
])
176-
updateGitHubStatus()
174+
/* TEMP TEST */
175+
Discord.notify(
176+
header: 'Desktop E2E test failure!',
177+
cred: 'discord-status-desktop-e2e-webhook',
178+
)
179+
//archiveArtifacts('aut/*.log')
180+
//allure([
181+
// results: [[path: 'allure-results']],
182+
// reportBuildPolicy: 'ALWAYS',
183+
// properties: [],
184+
// jdk: '',
185+
//])
186+
//updateGitHubStatus()
177187
} }
188+
//failure { script {
189+
// discord.notify(
190+
// header: 'Desktop E2E test failure!',
191+
// cred: 'discord-status-desktop-e2e-webhook',
192+
// )
193+
//} }
178194
cleanup { cleanWs() }
179195
}
180196
}

0 commit comments

Comments
 (0)