-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
179 lines (166 loc) · 7.06 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
#!groovy
def BN = (BRANCH_NAME == 'master' || BRANCH_NAME.startsWith('releases/')) ? BRANCH_NAME : 'releases/2025-07'
library "knime-pipeline@$BN"
def baseBranch = (BN == KNIMEConstants.NEXT_RELEASE_BRANCH ? "master" : BN.replace("releases/",""))
properties([
pipelineTriggers([
upstream(
'knime-core/' + env.BRANCH_NAME.replaceAll('/', '%2F') +
', knime-core-table/' + env.BRANCH_NAME.replaceAll('/', '%2F')
)
]),
parameters(
workflowTests.getConfigurationsAsParameters([columnarBackendDefault: true]) +
[
booleanParam(
defaultValue: true,
description: "Run knime-base workflow tests with the columnar backend",
name: "KNIME_BASE_WORKFLOW_TESTS",
),
booleanParam(
defaultValue: false,
description: "Use the HeapBadger instead of the Object Cache",
name: "USE_HEAP_BADGER",
),
booleanParam(
defaultValue: BRANCH_NAME == 'master',
description: "Run the benchmarks",
name: "RUN_BENCHMARKS",
),
],
),
buildDiscarder(logRotator(numToKeepStr: '5')),
disableConcurrentBuilds()
])
try {
knimetools.defaultTychoBuild('org.knime.update.core.columnar')
stage("knime-core-columnar workflow tests") {
workflowTests.runTests(
dependencies: [
repositories: ['knime-core-columnar', 'knime-datageneration', 'knime-jep', 'knime-ensembles', 'knime-xml', 'knime-distance']
]
)
}
if (params["KNIME_BASE_WORKFLOW_TESTS"]) {
vmArgs = ''
if (params["USE_HEAP_BADGER"]) {
vmArgs = '-Dknime.columnar.heapbadger.enable=true'
}
stage("knime-base workflow tests (${vmArgs})") {
withEnv(["MALLOC_ARENA_MAX=1"]) {
def testflowsDir = "Testflows (${baseBranch})/knime-base"
def excludedTestflows = [
"\\\\QDate&Time/test_AP-6112_DateTimeDifference\\\\E",
"\\\\QDate&Time/test_AP-6963_StringToDurationPeriod\\\\E",
"\\\\QTransformation/test_CollectionCreator3\\\\E",
"\\\\QFlow Control/test_endModelCase\\\\E", // TODO AP-20719 - fix this test
].join('|')
def testflowsRegex =
"/\\\\Q${testflowsDir}\\\\E/(?:(?!OS|\\\\QFile Handling v2\\\\E|Staging|${excludedTestflows})|OS/__KNIME_OS__/|\\\\QStaging/${BRANCH_NAME}\\\\E).+"
workflowTests.runTests(
testflowsDir: testflowsDir,
testflowsRegex: testflowsRegex,
additionalVmArguments: vmArgs,
dependencies: [
repositories: [
"knime-aws",
"knime-base",
"knime-bigdata",
"knime-bigdata-externals",
"knime-birt",
"knime-chemistry",
"knime-cloud",
"knime-conda",
"knime-core",
"knime-core-ui",
"knime-credentials-base",
"knime-database",
"knime-database-proprietary",
"knime-datageneration",
"knime-distance",
"knime-ensembles",
"knime-excel",
"knime-expressions",
"knime-exttool",
"knime-filehandling",
"knime-gateway",
"knime-h2o",
"knime-jep",
"knime-jfreechart",
"knime-js-base",
"knime-js-core",
"knime-js-labs",
"knime-kerberos",
"knime-office365",
"knime-optimization",
"knime-parquet",
"knime-pmml",
"knime-pmml-compilation",
"knime-pmml-translation",
"knime-python",
"knime-python",
"knime-python-legacy",
"knime-r",
"knime-scripting-editor",
"knime-stats",
"knime-streaming",
"knime-svg",
"knime-svm",
"knime-testing-internal",
"knime-textprocessing",
"knime-timeseries",
"knime-weka",
"knime-wide-data",
"knime-xml",
],
ius: ["org.knime.features.chem.types.feature.group"],
],
sidecarContainers: [
[ image: "${dockerTools.ECR}/knime/sshd:alpine3.11", namePrefix: "SSHD", port: 22 ]
]
)
}
}
}
// TODO run on a specific benchmark node
if (params["RUN_BENCHMARKS"]) {
node('maven && java17 && ubuntu22.04 && workflow-tests') {
stage('Run benchmarks') {
withEnv(["MALLOC_ARENA_MAX=1"]) {
env.lastStage = env.STAGE_NAME
// Checkout source code
checkout scm
// Run benchmarks
withMaven(mavenOpts: '-Xmx10G') {
withCredentials([
usernamePassword(credentialsId: 'ARTIFACTORY_CREDENTIALS',
passwordVariable: 'ARTIFACTORY_PASSWORD',
usernameVariable: 'ARTIFACTORY_LOGIN'),
]) {
sh '''
mvn -e -Dmaven.test.failure.ignore=true -Dtycho.localArtifacts=ignore -Dknime.p2.repo=${P2_REPO} clean verify -Pbenchmark
'''
}
}
// Archive results
resultFile = "target/benchmark-results.json"
sh """
jq -s add \$(find . -path "*/target/surefire-reports/benchmark-results.json") > ${WORKSPACE}/${resultFile}
"""
archiveArtifacts artifacts: resultFile
jmhReport resultFile
}
}
}
}
stage('Sonarqube analysis') {
env.lastStage = env.STAGE_NAME
workflowTests.runSonar()
}
} catch (ex) {
currentBuild.result = 'FAILURE'
throw ex
} finally {
notifications.notifyBuild(currentBuild.result);
}
/* vim: set shiftwidth=4 expandtab smarttab: */