Skip to content

Commit f7fa6cf

Browse files
committed
ci: archive sharness trash dirs
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
1 parent f7a9809 commit f7fa6cf

File tree

1 file changed

+24
-26
lines changed

1 file changed

+24
-26
lines changed

ci/Jenkinsfile

+24-26
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,28 @@ def gobuild_step(list) {
6868
}
6969
}
7070

71+
def sharness_step = { run, osname, makeargs, ignore ->
72+
timeout(time: sharness_timeout, unit: 'MINUTES') {
73+
run "make gx-deps"
74+
75+
try {
76+
run "make -j12 ${makeargs} test/sharness/test-results/sharness.xml CONTINUE_ON_S_FAILURE=1 TEST_NO_FUSE=1 TEST_NO_DOCKER=1"
77+
78+
try {
79+
// archive trash directories if any
80+
run "tar -czf sharnessTrashDirs-${osname}.tar.gz test/sharness/trash\\ *"
81+
archiveArtifacts artifacts: "sharnessTrashDirs-${osname}.tar.gz", fingerprint: true
82+
} catch (_) {}
83+
} catch (err) {
84+
throw err
85+
} finally {
86+
if (!ignore) {
87+
junit allowEmptyResults: true, testResults: 'test/sharness/test-results/sharness.xml'
88+
}
89+
}
90+
}
91+
}
92+
7193
/* PIPELINE */
7294

7395
ansiColor('xterm') { withEnv(['TERM=xterm-color']) {
@@ -140,36 +162,12 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) {
140162
},
141163
linuxSharness: {
142164
setupStep('linux') { run ->
143-
timeout(time: sharness_timeout, unit: 'MINUTES') {
144-
run 'go get -v github.com/jstemmer/go-junit-report'
145-
run "make gx-deps"
146-
147-
try {
148-
run "make -j12 -Otarget test/sharness/test-results/sharness.xml CONTINUE_ON_S_FAILURE=1 TEST_NO_FUSE=1 TEST_NO_DOCKER=1"
149-
} catch (err) {
150-
throw err
151-
} finally {
152-
junit allowEmptyResults: true, testResults: 'test/sharness/test-results/sharness.xml'
153-
}
154-
}
165+
sharness_step(run, 'linux', '-Otarget', false)
155166
}
156167
},
157168
macOS: {
158169
setupStep('macos') { run ->
159-
timeout(time: gotest_timeout, unit: 'MINUTES') {
160-
run 'go get -v github.com/jstemmer/go-junit-report'
161-
run "make gx-deps"
162-
163-
try {
164-
run test + ' -tags="nofuse" 2>&1 | tee output'
165-
run 'cat output | go-junit-report > junit-report-macos.xml'
166-
} catch (err) {
167-
throw err
168-
} finally {
169-
/* IGNORE TEST FAILS */
170-
/* junit 'junit-report-*.xml' */
171-
}
172-
}
170+
sharness_step(run, 'macos', '', true)
173171
}
174172
},
175173
macSharness: {

0 commit comments

Comments
 (0)