|
1 | 1 | @Library('shared-libraries') _ |
2 | 2 |
|
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 = false) { |
| 4 | + def mochaGlob = excludeFragileTests ? |
| 5 | + 'test-basic/!(documents-data-movement-*).js' : |
| 6 | + 'test-basic/' |
| 7 | + |
| 8 | + sh label: 'deploy-test-app-and-run-tests', script: """ |
| 9 | + export JAVA_HOME=\$JAVA_HOME_DIR |
| 10 | + export GRADLE_USER_HOME=\$WORKSPACE/\$GRADLE_DIR |
| 11 | + export PATH=\$JAVA_HOME/bin:\${NODE_HOME_DIR}/bin:\$PATH |
8 | 12 | cd node-client-api |
9 | 13 | node --version |
10 | 14 | npm --version |
11 | 15 | npm ci |
12 | 16 |
|
13 | 17 | cd test-app |
14 | 18 | ./gradlew -i mlWaitTillReady |
15 | | - sleep 3 |
16 | | - ./gradlew -i mlWaitTillReady |
17 | 19 | ./gradlew -i mlTestConnections |
18 | 20 | ./gradlew -i mlDeploy |
19 | 21 | ./gradlew -i -Penv=e2e mlLoadData mlLoadModules |
20 | 22 |
|
21 | 23 | 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 |
| 24 | + rm -rf \$WORKSPACE/*.xml || true |
| 25 | + ./node_modules/.bin/mocha --timeout 10000 -R xunit ${mochaGlob} --reporter mocha-junit-reporter --reporter-options mochaFile=\$WORKSPACE/test-basic-reports.xml || true |
24 | 26 | ./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 | | - ''' |
| 27 | + ./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 |
| 28 | + """ |
27 | 29 | junit '**/*.xml' |
28 | 30 | } |
29 | 31 |
|
@@ -152,7 +154,7 @@ pipeline { |
152 | 154 | runLint() |
153 | 155 | runTypeCheck() |
154 | 156 | runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12') |
155 | | - runTests() |
| 157 | + runTests(true) |
156 | 158 | runTypeScriptTests() |
157 | 159 | runE2ETests() |
158 | 160 | } |
|
0 commit comments