11@Library (' shared-libraries' ) _
22
3- def runTests () {
4- sh label : ' deploy-test-app-and-run-tests' , script : '''
5- export JAVA_HOME=$JAVA_HOME_DIR
6- export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
7- export PATH=$JAVA_HOME/bin:${NODE_HOME_DIR}/bin:$PATH
3+ def runTests (excludeFragileTests ) {
4+ def excludeFlag = excludeFragileTests ? ' --exclude "test-basic/documents-data-movement-*.js"' : ' '
5+
6+ sh label : ' deploy-test-app-and-run-tests' , script : """
7+ export JAVA_HOME=\$ JAVA_HOME_DIR
8+ export GRADLE_USER_HOME=\$ WORKSPACE/\$ GRADLE_DIR
9+ export PATH=\$ JAVA_HOME/bin:\$ {NODE_HOME_DIR}/bin:\$ PATH
810 cd node-client-api
911 node --version
1012 npm --version
1113 npm ci
1214
1315 cd test-app
1416 ./gradlew -i mlWaitTillReady
15- sleep 3
16- ./gradlew -i mlWaitTillReady
1717 ./gradlew -i mlTestConnections
1818 ./gradlew -i mlDeploy
1919 ./gradlew -i -Penv=e2e mlLoadData mlLoadModules
2020
2121 cd ..
22- rm -rf $WORKSPACE/*.xml || true
23- ./node_modules/.bin/mocha --timeout 10000 -R xunit test-basic/ --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/test-basic-reports.xml || true
22+ rm -rf \ $ WORKSPACE/*.xml || true
23+ ./node_modules/.bin/mocha --timeout 10000 -R xunit test-basic/ ${ excludeFlag } --reporter mocha-junit-reporter --reporter-options mochaFile=\ $ WORKSPACE/test-basic-reports.xml || true
2424 ./node_modules/.bin/gulp setupProxyTests || true
25- ./node_modules/.bin/mocha --timeout 10000 -R xunit test-basic-proxy/lib/**/*.js --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/test-basic-proxy-reports.xml || true
26- '''
25+ ./node_modules/.bin/mocha --timeout 10000 -R xunit test-basic-proxy/lib/**/*.js --reporter mocha-junit-reporter --reporter-options mochaFile=\ $ WORKSPACE/test-basic-proxy-reports.xml || true
26+ """
2727 junit ' **/*.xml'
2828}
2929
@@ -152,7 +152,7 @@ pipeline {
152152 runLint()
153153 runTypeCheck()
154154 runDockerCompose(' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12' )
155- runTests()
155+ runTests(true )
156156 runTypeScriptTests()
157157 runE2ETests()
158158 }
@@ -176,7 +176,7 @@ pipeline {
176176 agent { label ' nodeclientpool' }
177177 steps {
178178 runDockerCompose(' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-11' )
179- runTests()
179+ runTests(false )
180180 runTypeScriptTests()
181181 runE2ETests()
182182 }
@@ -197,7 +197,7 @@ pipeline {
197197 agent { label ' nodeclientpool' }
198198 steps {
199199 runDockerCompose(' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12' )
200- runTests()
200+ runTests(false )
201201 runTypeScriptTests()
202202 runE2ETests()
203203 }
@@ -218,7 +218,7 @@ pipeline {
218218 agent { label ' nodeclientpool' }
219219 steps {
220220 runDockerCompose(' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-10' )
221- runTests()
221+ runTests(false )
222222 runTypeScriptTests()
223223 runE2ETests()
224224 }
0 commit comments