-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathJenkinsfile
More file actions
146 lines (142 loc) · 6.05 KB
/
Copy pathJenkinsfile
File metadata and controls
146 lines (142 loc) · 6.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
@Library('shared-libraries') _
def runTests(String type,String version){
copyRPM type,version
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
sh '''
export PATH=${NODE_HOME_DIR}/bin:$PATH
cd node-client-api
node --version
npm --version
npm install
node etc/test-setup.js -u admin:admin
rm -rf $WORKSPACE/*.xml || true
./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
./node_modules/.bin/gulp setupProxyTests || true
./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
node etc/test-teardown.js -u admin:admin
'''
}
def runAuditReport(){
sh '''
export PATH=${NODE_HOME_DIR}/bin:$PATH
cd node-client-api
npm install
rm -rf $WORKSPACE/npm-audit-report.json || true
npm audit -json > $WORKSPACE/npm-audit-report.json
'''
}
def runE2ETests(String type,String version){
copyRPM type,version
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
sh '''
export PATH=${NODE_HOME_DIR}/bin:$PATH
cd node-client-api
node --version
npm --version
npm install
node etc/test-setup-qa.js
node etc/test-setup-dmsdk-qa.js
node config-optic/setupqa.js
./node_modules/.bin/mocha -R xunit --timeout 60000 test-complete/ --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/test-complete-results.xml || true
cd test-complete-proxy
npm install --global gulp-cli
gulp loadToModulesDB
gulp generateFnClasses
gulp copyFnClasses
cp *.js ../test-complete/
cp -R ml-modules/ ../test-complete
cd ../test-complete
../node_modules/.bin/mocha -R xunit --timeout 60000 nodejs-ds-setup-docs.js
../node_modules/.bin/mocha -R xunit --timeout 60000 "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 60000 "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 60000 -R xunit "nodejs-ds-multipleWorker.js" --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/ds-multipleWorker-results.xml || true
../node_modules/.bin/mocha -R xunit --timeout 60000 -R xunit "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 60000 -R xunit "nodejs-ds-dynamic.js" --reporter mocha-junit-reporter --reporter-options mochaFile=$WORKSPACE/ds-dynamic-results.xml || true
node ../etc/test-teardown-qa.js
'''
junit '**/*.xml'
}
pipeline{
agent none
triggers{
parameterizedCron(env.BRANCH_NAME == "develop" ? "00 02 * * * % regressions=true" : "")
}
parameters{
booleanParam(name: 'regressions', defaultValue: false, description: 'indicator if build is for regressions')
}
options {
checkoutToSubdirectory 'node-client-api'
buildDiscarder logRotator(artifactDaysToKeepStr: '7', artifactNumToKeepStr: '', daysToKeepStr: '7', numToKeepStr: '10')
}
environment{
NODE_HOME_DIR= "/home/builder/nodeJs/node-v18.14.0-linux-x64"
DMC_USER = credentials('MLBUILD_USER')
DMC_PASSWORD = credentials('MLBUILD_PASSWORD')
}
stages{
stage('runtests-11.0.2'){
agent {label 'nodeclientpool'}
steps{
runAuditReport()
runTests('Release','11.0.2')
runE2ETests('Release','11.0.2')
}
}
stage('regressions'){
parallel{
stage('runtests-11-nightly'){
when{
allOf{
branch 'develop'
expression {return params.regressions}
}
}
agent {label 'nodeclientpool'}
steps{
runTests('Latest','11')
runE2ETests('Latest','11')
}
}
stage('runtests-12-nightly'){
when{
allOf{
branch 'develop'
expression {return params.regressions}
}
}
agent {label 'nodeclientpool'}
steps{
runTests('Latest','12.0')
runE2ETests('Latest','12.0')
}
}
stage('runtests-10-nightly'){
when{
allOf{
branch 'develop'
expression {return params.regressions}
}
}
agent {label 'nodeclientpool'}
steps{
runTests('Latest','10.0')
runE2ETests('Latest','10.0')
}
}
stage('runtests-10.0-10'){
when{
allOf{
branch 'develop'
expression {return params.regressions}
}
}
agent {label 'nodeclientpool'}
steps{
runTests('Release','10.0-10')
runE2ETests('Release','10.0-10')
}
}
}
}
}
}