11@Library (' shared-libraries' ) _
22
3- def runTests (String type ,String version ){
4- copyRPM type,version
5- setUpML ' $WORKSPACE/xdmp/src/Mark*.rpm'
3+ def runTests (){
64 sh '''
75 export JAVA_HOME=$JAVA_HOME_DIR
86 export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
@@ -11,8 +9,11 @@ def runTests(String type,String version){
119 node --version
1210 npm --version
1311 npm ci
12+
1413 cd test-app
15- ./gradlew -i mlDeploy -g $PWD
14+ ./gradlew -i mlTestConnections
15+ ./gradlew -i mlDeploy
16+
1617 cd ..
1718 rm -rf $WORKSPACE/*.xml || true
1819 ./node_modules/.bin/mocha --timeout 10000 -R xunit test-basic/ --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/test-basic-reports.xml -g \' logging|archivePath\' --invert || true
@@ -35,28 +36,6 @@ def runDockerCompose(String markLogicDockerImage) {
3536 '''
3637}
3738
38- def runDockerTests () {
39- sh label :' deploy ml-gradle test application' , script : ''' #!/bin/bash
40- export JAVA_HOME=$JAVA17_HOME_DIR
41- export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
42- export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH:${NODE_HOME_DIR}/bin:$PATH
43-
44- cd node-client-api/test-app
45- ./gradlew -i mlTestConnections
46- ./gradlew -i mlDeploy
47-
48- cd ..
49- node --version
50- npm --version
51- npm ci
52- rm -rf $WORKSPACE/*.xml || true
53-
54- ./node_modules/.bin/mocha --timeout 10000 -R xunit test-basic/ --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/test-basic-reports.xml -g \' logging|archivePath\' --invert || true
55- ./node_modules/.bin/gulp setupProxyTests || true
56- ./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 -g \' logging|archivePath\' --invert || true
57- '''
58- }
59-
6039def teardownAfterTests () {
6140 updateWorkspacePermissions()
6241 sh label :' mlcleanup' , script : ''' #!/bin/bash
@@ -76,9 +55,7 @@ def runAuditReport(){
7655 '''
7756}
7857
79- def runE2ETests (String type ,String version ){
80- copyRPM type,version
81- setUpML ' $WORKSPACE/xdmp/src/Mark*.rpm'
58+ def runE2ETests (){
8259 sh '''
8360 export PATH=${NODE_HOME_DIR}/bin:$PATH
8461 cd node-client-api
@@ -145,9 +122,8 @@ pipeline{
145122 steps{
146123 runAuditReport()
147124 runDockerCompose(' progressofficial/marklogic-db:latest-11.3' )
148- runDockerTests()
149- // runTests('Release','11.3.1')
150- // runE2ETests('Release','11.3.1')
125+ runTests()
126+ runE2ETests()
151127 }
152128 post{
153129 always{
@@ -166,8 +142,14 @@ pipeline{
166142 }
167143 agent {label ' nodeclientpool' }
168144 steps{
169- runTests(' Latest' ,' 11' )
170- runE2ETests(' Latest' ,' 11' )
145+ runDockerCompose(' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-11' )
146+ runTests()
147+ runE2ETests()
148+ }
149+ post{
150+ always{
151+ teardownAfterTests()
152+ }
171153 }
172154 }
173155 stage(' runtests-12-nightly' ){
@@ -179,8 +161,14 @@ pipeline{
179161 }
180162 agent {label ' nodeclientpool' }
181163 steps{
182- runTests(' Latest' ,' 12.0' )
183- runE2ETests(' Latest' ,' 12.0' )
164+ runDockerCompose(' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12' )
165+ runTests()
166+ runE2ETests()
167+ }
168+ post{
169+ always{
170+ teardownAfterTests()
171+ }
184172 }
185173 }
186174 stage(' runtests-10-nightly' ){
@@ -192,21 +180,14 @@ pipeline{
192180 }
193181 agent {label ' nodeclientpool' }
194182 steps{
195- runTests(' Latest' ,' 10.0' )
196- runE2ETests(' Latest' ,' 10.0' )
183+ runDockerCompose(' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-10' )
184+ runTests()
185+ runE2ETests()
197186 }
198- }
199- stage(' runtests-10.0-10.2' ){
200- when{
201- allOf{
202- branch ' develop'
203- expression {return params. regressions}
204- }
187+ post{
188+ always{
189+ teardownAfterTests()
205190 }
206- agent {label ' nodeclientpool' }
207- steps{
208- runTests(' Release' ,' 10.0-10.2' )
209- runE2ETests(' Release' ,' 10.0-10.2' )
210191 }
211192 }
212193 }
0 commit comments