Skip to content

Commit 0589ad9

Browse files
renovate[bot]timja
andauthored
Update dependency org.jenkins-ci.plugins:plugin to v5.28 (#760)
* Update dependency org.jenkins-ci.plugins:plugin to v5.28 * mvn spotless:apply --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tim Jacomb <[email protected]>
1 parent b7d43b4 commit 0589ad9

File tree

5 files changed

+32
-63
lines changed

5 files changed

+32
-63
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.jenkins-ci.plugins</groupId>
66
<artifactId>plugin</artifactId>
7-
<version>5.27</version>
7+
<version>5.28</version>
88
<relativePath />
99
</parent>
1010

src/test/java/hudson/tasks/junit/pipeline/JUnitResultsStepTest.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,7 @@ void parallelInStage() throws Exception {
288288
copyToWorkspace(j, TestResultTest.class.getResource("junit-report-2874.xml"), "second-result.xml");
289289
copyToWorkspace(j, TestResultTest.class.getResource("junit-report-nested-testsuites.xml"), "third-result.xml");
290290

291-
j.setDefinition(new CpsFlowDefinition(
292-
"""
291+
j.setDefinition(new CpsFlowDefinition("""
293292
stage('first') {
294293
node {
295294
touch 'first-result.xml'
@@ -300,8 +299,7 @@ void parallelInStage() throws Exception {
300299
c: { def third = junit(testResults: 'third-result.xml', keepTestNames: true); assert third.totalCount == 3 })
301300
}
302301
}
303-
""",
304-
true));
302+
""", true));
305303
WorkflowRun r = rule.assertBuildStatus(
306304
Result.UNSTABLE, rule.waitForCompletion(j.scheduleBuild2(0).waitForStart()));
307305
TestResultAction action = r.getAction(TestResultAction.class);
@@ -323,8 +321,7 @@ void stageInParallel() throws Exception {
323321
copyToWorkspace(j, TestResultTest.class.getResource("junit-report-2874.xml"), "second-result.xml");
324322
copyToWorkspace(j, TestResultTest.class.getResource("junit-report-nested-testsuites.xml"), "third-result.xml");
325323

326-
j.setDefinition(new CpsFlowDefinition(
327-
"""
324+
j.setDefinition(new CpsFlowDefinition("""
328325
stage('outer') {
329326
node {
330327
touch 'first-result.xml'
@@ -335,8 +332,7 @@ void stageInParallel() throws Exception {
335332
c: { stage('d') { def third = junit(testResults: 'third-result.xml', keepTestNames: true); assert third.totalCount == 3 } })
336333
}
337334
}
338-
""",
339-
true));
335+
""", true));
340336
WorkflowRun r = rule.assertBuildStatus(
341337
Result.UNSTABLE, rule.waitForCompletion(j.scheduleBuild2(0).waitForStart()));
342338
TestResultAction action = r.getAction(TestResultAction.class);
@@ -358,8 +354,7 @@ void stageInParallel() throws Exception {
358354
@Test
359355
void testTrends() throws Exception {
360356
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "testTrends");
361-
j.setDefinition(new CpsFlowDefinition(
362-
"""
357+
j.setDefinition(new CpsFlowDefinition("""
363358
node {
364359
stage('first') {
365360
touch 'junit-report-testTrends-first.xml'
@@ -370,8 +365,7 @@ void testTrends() throws Exception {
370365
def second = junit(testResults: "junit-report-testTrends-second.xml")
371366
}
372367
}
373-
""",
374-
true));
368+
""", true));
375369
FilePath ws = rule.jenkins.getWorkspaceFor(j);
376370
FilePath firstFile = ws.child("junit-report-testTrends-first.xml");
377371
FilePath secondFile = ws.child("junit-report-testTrends-second.xml");
@@ -471,8 +465,7 @@ void skipBuildUnstable() throws Exception {
471465
@Test
472466
void ageResetSameTestSuiteName() throws Exception {
473467
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "p");
474-
j.setDefinition(new CpsFlowDefinition(
475-
"""
468+
j.setDefinition(new CpsFlowDefinition("""
476469
stage('stage 1') {
477470
node {
478471
touch 'ageReset-1.xml'
@@ -485,8 +478,7 @@ void ageResetSameTestSuiteName() throws Exception {
485478
junit(testResults: '*-2.xml')
486479
}
487480
}
488-
""",
489-
true));
481+
""", true));
490482
copyToWorkspace(j, JUnitResultsStepTest.class.getResource("ageReset-1.xml"), "ageReset-1.xml");
491483
copyToWorkspace(j, JUnitResultsStepTest.class.getResource("ageReset-2.xml"), "ageReset-2.xml");
492484
WorkflowRun r = rule.waitForCompletion(j.scheduleBuild2(0).waitForStart());

src/test/java/io/jenkins/plugins/junit/checks/JUnitChecksPublisherTest.java

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,15 @@ private List<ChecksDetails> getDetails() {
5454
@SuppressWarnings("OptionalGetWithoutIsPresent")
5555
void extractChecksDetailsPassingTestResults() throws Exception {
5656
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
57-
j.setDefinition(new CpsFlowDefinition(
58-
"""
57+
j.setDefinition(new CpsFlowDefinition("""
5958
stage('first') {
6059
node {
6160
touch 'test-result.xml'
6261
def results = junit(testResults: '*.xml')
6362
assert results.totalCount == 6
6463
}
6564
}
66-
""",
67-
true));
65+
""", true));
6866
FilePath ws = rule.jenkins.getWorkspaceFor(j);
6967
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");
7068
testFile.copyFrom(TestResultTest.class.getResource("junit-report-1463.xml"));
@@ -87,16 +85,14 @@ void extractChecksDetailsPassingTestResults() throws Exception {
8785
@SuppressWarnings("OptionalGetWithoutIsPresent")
8886
void extractChecksDetailsFailingSingleTestResult() throws Exception {
8987
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
90-
j.setDefinition(new CpsFlowDefinition(
91-
"""
88+
j.setDefinition(new CpsFlowDefinition("""
9289
stage('first') {
9390
node {
9491
def results = junit(testResults: '*.xml')
9592
assert results.totalCount == 6
9693
}
9794
}
98-
""",
99-
true));
95+
""", true));
10096
FilePath ws = rule.jenkins.getWorkspaceFor(j);
10197
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");
10298
testFile.copyFrom(TestResultTest.class.getResource("junit-report-errror-details.xml"));
@@ -118,16 +114,14 @@ void extractChecksDetailsFailingSingleTestResult() throws Exception {
118114
@SuppressWarnings("OptionalGetWithoutIsPresent")
119115
void extractChecksDetailsFailingMultipleTests() throws Exception {
120116
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
121-
j.setDefinition(new CpsFlowDefinition(
122-
"""
117+
j.setDefinition(new CpsFlowDefinition("""
123118
stage('first') {
124119
node {
125120
def results = junit(testResults: '*.xml')
126121
assert results.totalCount == 6
127122
}
128123
}
129-
""",
130-
true));
124+
""", true));
131125
FilePath ws = rule.jenkins.getWorkspaceFor(j);
132126
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");
133127
testFile.copyFrom(TestResultTest.class.getResource("junit-report-20090516.xml"));
@@ -149,17 +143,15 @@ void extractChecksDetailsFailingMultipleTests() throws Exception {
149143
@SuppressWarnings("OptionalGetWithoutIsPresent")
150144
void extractChecksDetailsCustomCheckName() throws Exception {
151145
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
152-
j.setDefinition(new CpsFlowDefinition(
153-
"""
146+
j.setDefinition(new CpsFlowDefinition("""
154147
stage('first') {
155148
node {
156149
touch 'test-result.xml'
157150
def results = junit(testResults: '*.xml', checksName: 'Custom Checks Name')
158151
assert results.totalCount == 6
159152
}
160153
}
161-
""",
162-
true));
154+
""", true));
163155
FilePath ws = rule.jenkins.getWorkspaceFor(j);
164156
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");
165157
testFile.copyFrom(TestResultTest.class.getResource("junit-report-1463.xml"));
@@ -177,15 +169,13 @@ void extractChecksDetailsCustomCheckName() throws Exception {
177169
@SuppressWarnings("OptionalGetWithoutIsPresent")
178170
void extractChecksDetailsNoStageContext() throws Exception {
179171
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
180-
j.setDefinition(new CpsFlowDefinition(
181-
"""
172+
j.setDefinition(new CpsFlowDefinition("""
182173
node {
183174
touch 'test-result.xml'
184175
def results = junit(testResults: '*.xml')
185176
assert results.totalCount == 6
186177
}
187-
""",
188-
true));
178+
""", true));
189179
FilePath ws = rule.jenkins.getWorkspaceFor(j);
190180
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");
191181
testFile.copyFrom(TestResultTest.class.getResource("junit-report-1463.xml"));
@@ -201,16 +191,14 @@ void extractChecksDetailsNoStageContext() throws Exception {
201191
@SuppressWarnings("OptionalGetWithoutIsPresent")
202192
void extractChecksDetailsNestedStages() throws Exception {
203193
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
204-
j.setDefinition(new CpsFlowDefinition(
205-
"""
194+
j.setDefinition(new CpsFlowDefinition("""
206195
stage('first') { stage('second') {
207196
node {
208197
def results = junit(testResults: '*.xml')
209198
assert results.totalCount == 6
210199
}
211200
}}
212-
""",
213-
true));
201+
""", true));
214202
FilePath ws = rule.jenkins.getWorkspaceFor(j);
215203
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");
216204
testFile.copyFrom(TestResultTest.class.getResource("junit-report-1463.xml"));
@@ -226,16 +214,14 @@ void extractChecksDetailsNestedStages() throws Exception {
226214
@SuppressWarnings("OptionalGetWithoutIsPresent")
227215
void extractChecksDetailsEmptySuite() throws Exception {
228216
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
229-
j.setDefinition(new CpsFlowDefinition(
230-
"""
217+
j.setDefinition(new CpsFlowDefinition("""
231218
stage('first') {
232219
node {
233220
def results = junit(testResults: '*.xml', allowEmptyResults: true)
234221
assert results.totalCount == 0
235222
}
236223
}
237-
""",
238-
true));
224+
""", true));
239225

240226
rule.buildAndAssertSuccess(j);
241227

@@ -253,8 +239,7 @@ void extractChecksDetailsEmptySuite() throws Exception {
253239
@SuppressWarnings("OptionalGetWithoutIsPresent")
254240
void withChecksContext() throws Exception {
255241
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
256-
j.setDefinition(new CpsFlowDefinition(
257-
"""
242+
j.setDefinition(new CpsFlowDefinition("""
258243
stage('first') {
259244
node {
260245
touch 'test-result.xml'
@@ -264,8 +249,7 @@ void withChecksContext() throws Exception {
264249
}
265250
}
266251
}
267-
""",
268-
true));
252+
""", true));
269253

270254
FilePath ws = rule.jenkins.getWorkspaceFor(j);
271255
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");
@@ -290,8 +274,7 @@ void withChecksContext() throws Exception {
290274
@SuppressWarnings("OptionalGetWithoutIsPresent")
291275
void withChecksContextDeclarative() throws Exception {
292276
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
293-
j.setDefinition(new CpsFlowDefinition(
294-
"""
277+
j.setDefinition(new CpsFlowDefinition("""
295278
pipeline {
296279
agent any
297280
stages {
@@ -303,8 +286,7 @@ void withChecksContextDeclarative() throws Exception {
303286
}
304287
}
305288
}
306-
}""",
307-
true));
289+
}""", true));
308290

309291
FilePath ws = rule.jenkins.getWorkspaceFor(j);
310292
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");
@@ -329,8 +311,7 @@ void withChecksContextDeclarative() throws Exception {
329311
@SuppressWarnings("OptionalGetWithoutIsPresent")
330312
void withChecksContextWithCustomName() throws Exception {
331313
WorkflowJob j = rule.jenkins.createProject(WorkflowJob.class, "singleStep");
332-
j.setDefinition(new CpsFlowDefinition(
333-
"""
314+
j.setDefinition(new CpsFlowDefinition("""
334315
stage('first') {
335316
node {
336317
touch 'test-result.xml'
@@ -340,8 +321,7 @@ void withChecksContextWithCustomName() throws Exception {
340321
}
341322
}
342323
}
343-
""",
344-
true));
324+
""", true));
345325

346326
FilePath ws = rule.jenkins.getWorkspaceFor(j);
347327
FilePath testFile = Objects.requireNonNull(ws).child("test-result.xml");

src/test/java/io/jenkins/plugins/junit/storage/TestResultStorageJunitTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ void smokes() throws Exception {
126126
// ((Channel) remote.getChannel()).addListener(new
127127
// LoggingChannelListener(Logger.getLogger(TestResultStorageTest.class.getName()), Level.INFO));
128128
WorkflowJob p = r.createProject(WorkflowJob.class, "p");
129-
p.setDefinition(new CpsFlowDefinition(
130-
"""
129+
p.setDefinition(new CpsFlowDefinition("""
131130
node('remote') {
132131
writeFile file: 'x.xml', text: '''<testsuite name='sweet' time='200.0'>
133132
<testcase classname='Klazz' name='test1' time='198.0'><error message='failure'/></testcase>
@@ -141,8 +140,7 @@ void smokes() throws Exception {
141140
</testsuite>'''
142141
s = junit testResults: 'x.xml', skipPublishingChecks: true
143142
echo(/next summary: fail=$s.failCount skip=$s.skipCount pass=$s.passCount total=$s.totalCount/)
144-
}""",
145-
true));
143+
}""", true));
146144
WorkflowRun b = p.scheduleBuild2(0).get();
147145
try (Connection connection = Objects.requireNonNull(
148146
GlobalDatabaseConfiguration.get().getDatabase())

src/test/java/io/jenkins/plugins/junit/storage/benchmarks/TrendGraphBenchmark.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public static class JenkinsState extends JmhBenchmarkState {
2424

2525
WorkflowJob lastJob;
2626

27-
public static final String SIMPLE_TEST_RESULT =
28-
"""
27+
public static final String SIMPLE_TEST_RESULT = """
2928
node {
3029
writeFile file: 'x.xml', text: '''<testsuite name='sweet' time='200.0'>
3130
<testcase classname='Klazz' name='test1' time='198.0'><error message='failure'/></testcase>

0 commit comments

Comments
 (0)