Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,18 @@ def runTypeScriptTests() {
junit '**/*test-typescript-reports.xml'
}

def runE2ETests() {
sh label: 'run-e2e-tests', script: '''
export PATH=${NODE_HOME_DIR}/bin:$PATH
def runE2ETests(excludeFragileTests) {
def excludeFlag = excludeFragileTests ? '--exclude "test-complete/nodejs-dmsdk*.js"' : ''
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The excludeFlag construction may cause command-line parsing issues because the exclude pattern contains unescaped quotes. Consider moving the quotes outside or ensuring proper escaping: def excludeFlag = excludeFragileTests ? '--exclude test-complete/nodejs-dmsdk*.js' : '' or using proper escaping for the shell context.

Suggested change
def excludeFlag = excludeFragileTests ? '--exclude "test-complete/nodejs-dmsdk*.js"' : ''
def excludeFlag = excludeFragileTests ? '--exclude test-complete/nodejs-dmsdk*.js' : ''

Copilot uses AI. Check for mistakes.

sh label: 'run-e2e-tests', script: """
export PATH=\${NODE_HOME_DIR}/bin:\$PATH
cd node-client-api
node --version
npm --version
npm ci

echo "Running test-complete tests"
./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
./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
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ${excludeFlag} variable may not be properly expanded when empty, potentially causing syntax errors in the shell command. When excludeFlag is an empty string, this could result in two consecutive spaces in the command. Consider using Groovy string interpolation more carefully or testing with an empty flag value.

Copilot uses AI. Check for mistakes.
echo "Done with test-complete tests"

cd test-complete-proxy
Expand All @@ -110,12 +112,12 @@ def runE2ETests() {
cp -R ml-modules/ ../test-complete
cd ../test-complete
../node_modules/.bin/mocha -R xunit --timeout 20000 nodejs-ds-setup-docs.js
../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
../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
../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
../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
../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
'''
../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
../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
../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
../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
../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
"""
junit '**/*.xml'
}

Expand Down Expand Up @@ -154,7 +156,7 @@ pipeline {
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12')
runTests(true)
runTypeScriptTests()
runE2ETests()
runE2ETests(true)
}
post {
always {
Expand All @@ -178,7 +180,7 @@ pipeline {
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-11')
runTests(false)
runTypeScriptTests()
runE2ETests()
runE2ETests(false)
}
post {
always {
Expand All @@ -199,7 +201,7 @@ pipeline {
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12')
runTests(false)
runTypeScriptTests()
runE2ETests()
runE2ETests(false)
}
post {
always {
Expand All @@ -220,7 +222,7 @@ pipeline {
runDockerCompose('ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-10')
runTests(false)
runTypeScriptTests()
runE2ETests()
runE2ETests(false)
}
post {
always {
Expand Down
Loading