forked from jakartaee/platform-tck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
259 lines (244 loc) · 9.6 KB
/
Jenkinsfile
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/*
* Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
env.label = "jakartaee-tck-pod-${UUID.randomUUID().toString()}"
default_suites=[ "compat12", "compat13", "concurrency", "connector", "ejb", "ejb30/bb", "ejb30/lite/appexception", "ejb30/lite/async", "ejb30/lite/basic", "ejb30/lite/ejbcontext", "ejb30/lite/enventry", "ejb30/lite/interceptor", "ejb30/lite/lookup", "ejb30/lite/naming", "ejb30/lite/nointerface", "", "ejb30/lite/packaging", "ejb30/lite/singleton", "ejb30/lite/stateful", "ejb30/lite/tx", "ejb30/lite/view", "ejb30/lite/xmloverride", "ejb30/assembly", "ejb30/timer", "ejb30/webservice", "ejb30/zombie", "ejb30/misc", "ejb30/sec", "ejb32", "el", "integration", "interop", "j2eetools", "jacc", "jaspic", "javaee", "javamail", "jaxr", "jaxrpc", "jaxrs", "jdbc_appclient", "jdbc_ejb", "jdbc_jsp", "jdbc_servlet", "jms_appclient", "jms_ejb", "jms_jsp", "jms_servlet", "jpa_appmanaged", "jpa_appmanagedNoTx", "jpa_pmservlet", "jpa_puservlet", "jpa_stateful3", "jpa_stateless3", "jsf", "jsonb", "jsonp", "jsp", "jstl", "jta", "jws", "rmiiiop", "samples", "securityapi", "servlet", "signaturetest/javaee", "webservices", "webservices12", "webservices13", "websocket", "xa"]
default_tcks=["caj", "concurrency", "connector", "el", "jacc", "jaspic", "jaxr", "jaxrpc", "jaxrs", "jaxws", "jms", "jpa", "jsf", "jsp", "jsonb", "jsonp", "jstl", "jta", "saaj", "securityapi", "servlet", "websocket"]
def cts_suites = params.test_suites != null ? params.test_suites.split() : default_suites
def tcks = params.standalone_tcks != null ? params.standalone_tcks.split() : default_tcks
def parallelCTSSuitesMap = cts_suites.collectEntries {
["${it}": generateCTSStage(it)]
}
def generateCTSStage(job) {
return {
podTemplate(label: env.label) {
node(label) {
stage("${job}") {
container('jakartaeetck-ci') {
unstash 'jakartaeetck-bundles'
sh """
env
unzip -o ${WORKSPACE}/jakartaeetck-bundles/javaeetck.zip -d ${CTS_HOME}
bash -x ${CTS_HOME}/javaeetck/docker/run_jakartaeetck.sh ${job}
"""
archiveArtifacts artifacts: "*-results.tar.gz,*-junitreports.tar.gz", allowEmptyArchive: true
junit testResults: 'results/junitreports/*.xml', allowEmptyResults: true
}
}
}
}
}
}
def parallelStandaloneTCKMap = tcks.collectEntries {
["${it}": generateStandaloneTCKStage(it)]
}
def generateStandaloneTCKStage(job) {
return {
podTemplate(label: env.label) {
node(label) {
stage("${job}") {
container('jakartaeetck-ci') {
checkout scm
unstash 'standalone-bundles'
sh """
env
bash -x ${WORKSPACE}/docker/${job}tck.sh
"""
archiveArtifacts artifacts: "${job}tck-results.tar.gz,*-junitreports.tar.gz",allowEmptyArchive: true
junit testResults: 'results/junitreports/*.xml', allowEmptyResults: true
}
}
}
}
}
}
pipeline {
options {
durabilityHint('PERFORMANCE_OPTIMIZED')
buildDiscarder(logRotator(numToKeepStr: '30', artifactDaysToKeepStr: '30'))
disableConcurrentBuilds()
}
agent {
kubernetes {
label "${env.label}"
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
spec:
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "localhost.localdomain"
- "james.local"
containers:
- name: jakartaeetck-ci
image: anajosep/cts-base:0.1
command:
- cat
tty: true
imagePullPolicy: Always
env:
- name: JAVA_TOOL_OPTIONS
value: -Xmx3G
resources:
limits:
memory: "4Gi"
cpu: "1.0"
- name: james-mail
image: anajosep/cts-mailserver:0.1
command:
- /root/startup.sh
ports:
- containerPort: 1025
- containerPort: 1143
tty: true
imagePullPolicy: Always
env:
- name: JAVA_TOOL_OPTIONS
value: -Xmx1G
resources:
limits:
memory: "1Gi"
cpu: "0.5"
"""
}
}
parameters {
string(name: 'GF_BUNDLE_URL',
defaultValue: '',
description: 'URL required for downloading GlassFish Full/Web profile bundle' )
string(name: 'GF_VERSION_URL',
defaultValue: '',
description: 'URL required for downloading GlassFish version details' )
string(name: 'TCK_BUNDLE_BASE_URL',
defaultValue: '',
description: 'Base URL required for downloading prebuilt binary TCK Bundle from a hosted location' )
choice(name: 'PROFILE', choices: 'FULL\nWEB',
description: 'Profile to be used for running CTS either web/full' )
choice(name: 'DATABASE', choices: 'JavaDB\nOracle\nMySQL',
description: 'Database to be used for running CTS. Currently only JavaDB is supported.' )
choice(name: 'BUILD_TYPE', choices: 'CTS\nSTANDALONE-TCK',
description: 'Run the full EE compliance testsuite or a standalone tck' )
string(name: 'test_suites', defaultValue: 'compat12 compat13 concurrency connector ejb ejb30/bb ejb30/lite/appexception ejb30/lite/async ejb30/lite/basic ejb30/lite/ejbcontext ejb30/lite/enventry ejb30/lite/interceptor ejb30/lite/lookup ejb30/lite/naming ejb30/lite/nointerface ejb30/lite/packaging ejb30/lite/singleton ejb30/lite/stateful ejb30/lite/tx ejb30/lite/view ejb30/lite/xmloverride ejb30/assembly ejb30/timer ejb30/webservice ejb30/zombie ejb30/misc ejb30/sec ejb32 el integration interop j2eetools jacc jaspic javaee javamail jaxr jaxrpc jaxrs jdbc_appclient jdbc_ejb jdbc_jsp jdbc_servlet jms_appclient jms_ejb jms_jsp jms_servlet jpa_appmanaged jpa_appmanagedNoTx jpa_pmservlet jpa_puservlet jpa_stateful3 jpa_stateless3 jsf jsonb jsonp jsp jstl jta jws rmiiiop samples securityapi servlet signaturetest/javaee webservices webservices12 webservices13 websocket xa',
description: 'Space separated list of Test suites to run')
string(name: 'standalone_tcks', defaultValue: 'caj concurrency connector el jacc jaspic jaxr jaxrpc jaxrs jaxws jms jpa jsf jsp jsonb jsonp jstl jta saaj securityapi servlet websocket',
description: 'Space separated list of standalone TCKs to build and run')
string(name: 'USER_KEYWORDS',
defaultValue: '',
description: 'Specific keywords provided by the user to be used for the test run.' )
}
environment {
CTS_HOME = "/root"
ANT_OPTS = "-Djavax.xml.accessExternalStylesheet=all -Djavax.xml.accessExternalSchema=all -Djavax.xml.accessExternalDTD=file,http"
MAIL_USER="user01@james.local"
MAIL_HOST="localhost"
LANG="en_US.UTF-8"
DEFAULT_GF_BUNDLE_URL="https://repo1.maven.org/maven2/org/glassfish/main/distributions/glassfish/5.1.0-RC1/glassfish-5.1.0-RC1.zip"
}
stages {
stage('jakartaeetck-build') {
when {
expression {
return params.BUILD_TYPE == 'CTS';
}
}
steps {
container('jakartaeetck-ci') {
sh """
env
bash -x ${WORKSPACE}/docker/build_jakartaeetck.sh
"""
archiveArtifacts artifacts: "jakartaeetck-bundles/*.zip,*.version", allowEmptyArchive: true
stash includes: 'jakartaeetck-bundles/*.zip', name: 'jakartaeetck-bundles'
}
}
}
stage('jakartaeetck-docbuild') {
when {
expression {
return params.BUILD_TYPE == 'CTS';
}
}
steps {
container('jakartaeetck-ci') {
sh """
env
bash -x ${WORKSPACE}/user_guides/build_tckugs.sh javaee
"""
archiveArtifacts artifacts: "user_guides/userguides.zip", allowEmptyArchive: true
}
}
}
stage('jakartaeetck-run') {
when {
expression {
return params.BUILD_TYPE == 'CTS';
}
}
steps {
script {
parallel parallelCTSSuitesMap
}
}
}
stage('standalone-tck-build') {
when {
expression {
return params.BUILD_TYPE == 'STANDALONE-TCK';
}
}
steps {
container('jakartaeetck-ci') {
sh """
env
bash -x ${WORKSPACE}/docker/build_standalone-tcks.sh ${standalone_tcks}
"""
archiveArtifacts artifacts: "standalone-bundles/*.zip,*.version", allowEmptyArchive: true
stash includes: 'standalone-bundles/*.zip', name: 'standalone-bundles'
}
}
}
stage('standalone-tck-docbuild') {
when {
expression {
return params.BUILD_TYPE == 'STANDALONE-TCK';
}
}
steps {
container('jakartaeetck-ci') {
sh """
env
bash -x ${WORKSPACE}/user_guides/build_tckugs.sh
"""
archiveArtifacts artifacts: "user_guides/userguides.zip", allowEmptyArchive: true
}
}
}
stage('standalone-tck-run') {
when {
expression {
return params.BUILD_TYPE == 'STANDALONE-TCK';
}
}
steps {
script {
parallel parallelStandaloneTCKMap
}
}
}
}
}