Skip to content

Commit e1c03ae

Browse files
committed
MLE-25617 More fragile test handling
1 parent c0f74fc commit e1c03ae

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

Jenkinsfile

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,18 @@ def runTypeScriptTests() {
8989
junit '**/*test-typescript-reports.xml'
9090
}
9191

92-
def runE2ETests() {
93-
sh label: 'run-e2e-tests', script: '''
94-
export PATH=${NODE_HOME_DIR}/bin:$PATH
92+
def runE2ETests(excludeFragileTests) {
93+
def excludeFlag = excludeFragileTests ? '--exclude "test-complete/nodejs-dmsdk*.js"' : ''
94+
95+
sh label: 'run-e2e-tests', script: """
96+
export PATH=\${NODE_HOME_DIR}/bin:\$PATH
9597
cd node-client-api
9698
node --version
9799
npm --version
98100
npm ci
99101
100102
echo "Running test-complete tests"
101-
./node_modules/.bin/mocha --no-parallel -R xunit --timeout 60000 test-complete/ --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/test-complete-results.xml || true
103+
./node_modules/.bin/mocha --no-parallel -R xunit --timeout 60000 test-complete/ ${excludeFlag} --reporter mocha-junit-reporter --reporter-options mochaFile=\$WORKSPACE/test-complete-results.xml || true
102104
echo "Done with test-complete tests"
103105
104106
cd test-complete-proxy
@@ -110,12 +112,12 @@ def runE2ETests() {
110112
cp -R ml-modules/ ../test-complete
111113
cd ../test-complete
112114
../node_modules/.bin/mocha -R xunit --timeout 20000 nodejs-ds-setup-docs.js
113-
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-required-params.js" --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/ds-required-params-results.xml || true
114-
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-error-map.js" --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/ds-multipleWorker-results.xml || true
115-
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-multipleWorker.js" --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/ds-multipleWorker-results.xml || true
116-
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-transactions.js" --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/ds-transactions-results.js.xml || true
117-
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-dynamic.js" --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/ds-dynamic-results.xml || true
118-
'''
115+
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-required-params.js" --reporter mocha-junit-reporter --reporter-options mochaFile=\$WORKSPACE/ds-required-params-results.xml || true
116+
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-error-map.js" --reporter mocha-junit-reporter --reporter-options mochaFile=\$WORKSPACE/ds-multipleWorker-results.xml || true
117+
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-multipleWorker.js" --reporter mocha-junit-reporter --reporter-options mochaFile=\$WORKSPACE/ds-multipleWorker-results.xml || true
118+
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-transactions.js" --reporter mocha-junit-reporter --reporter-options mochaFile=\$WORKSPACE/ds-transactions-results.js.xml || true
119+
../node_modules/.bin/mocha -R xunit --timeout 20000 "nodejs-ds-dynamic.js" --reporter mocha-junit-reporter --reporter-options mochaFile=\$WORKSPACE/ds-dynamic-results.xml || true
120+
"""
119121
junit '**/*.xml'
120122
}
121123

@@ -154,7 +156,7 @@ pipeline {
154156
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12')
155157
runTests(true)
156158
runTypeScriptTests()
157-
runE2ETests()
159+
runE2ETests(true)
158160
}
159161
post {
160162
always {
@@ -178,7 +180,7 @@ pipeline {
178180
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-11')
179181
runTests(false)
180182
runTypeScriptTests()
181-
runE2ETests()
183+
runE2ETests(false)
182184
}
183185
post {
184186
always {
@@ -199,7 +201,7 @@ pipeline {
199201
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12')
200202
runTests(false)
201203
runTypeScriptTests()
202-
runE2ETests()
204+
runE2ETests(false)
203205
}
204206
post {
205207
always {
@@ -220,7 +222,7 @@ pipeline {
220222
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-10')
221223
runTests(false)
222224
runTypeScriptTests()
223-
runE2ETests()
225+
runE2ETests(false)
224226
}
225227
post {
226228
always {

0 commit comments

Comments
 (0)