Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ${errorStackTrace}
<% description = (c?.displayDescription && c?.displayDescription != 'null') ? "<li>Description: <code>${c?.displayDescription}</code></l1>" : ''%>
<% duration = (c?.durationInMillis >= 0 ) ? "Took ${Math.round(c.durationInMillis/1000/60)} min ${Math.round(c.durationInMillis/1000)%60} sec" : ''%>
<% url = (c?.url && c?.url != 'null') ? ". View more details on <a href=\"${c?.url}/?start=0\">here</a>" : ''%>
##### `${c?.displayName && c?.displayName != 'null' ? c?.displayName : ''}`
##### `${c?.displayName && c?.displayName != 'null' ? c?.displayName.replaceAll('\\n', '') : ''}`
<ul>
<li>${duration} ${url}</li>
${description}
Expand Down
17 changes: 17 additions & 0 deletions src/test/groovy/NotificationManagerStepTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,23 @@ class NotificationManagerStepTests extends ApmBasePipelineTest {
assertJobStatusSuccess()
}

@Test
void test_notify_pr_with_unstable_and_multiline_steps_failures() throws Exception {
script.notifyPR(
build: readJSON(file: "build-info.json"),
buildStatus: "UNSTABLE",
changeSet: readJSON(file: "changeSet-info.json"),
log: f.getText(),
statsUrl: "https://ecs.example.com/app/kibana",
stepsErrors: readJSON(file: "steps-errors-with-multiline.json"),
testsErrors: readJSON(file: "tests-errors.json"),
testsSummary: readJSON(file: "tests-summary.json")
)
printCallStack()
assertTrue(assertMethodCallContainsPattern('githubPrComment', '`auditbeat-Lint - make -C auditbeat check;make -C auditbeat update;make -C x-pack/auditbeat check;`'))
assertJobStatusSuccess()
}

@Test
void test_notify_pr_with_unstable_and_multiple_steps_failures() throws Exception {
script.notifyPR(
Expand Down
26 changes: 26 additions & 0 deletions src/test/resources/steps-errors-with-multiline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"displayDescription": "make -C auditbeat check;make -C auditbeat update;make -C x-pack/auditbeat check;make -C x-pack/auditbeat update;make check-no-changes;",
"displayName": "auditbeat-Lint - make -C auditbeat check;\nmake -C auditbeat update;\nmake -C x-pack/auditbeat check;\n",
"durationInMillis": 78948,
"id": "1662",
"input": null,
"result": "FAILURE",
"startTime": "2021-02-16T14:15:06.350+0000",
"state": "FINISHED",
"type": "STAGE",
"url": "https://beats-ci.elastic.co//blue/rest/organizations/jenkins/pipelines/Beats/pipelines/beats/pipelines/PR-23966/runs/5/steps/1662/log"
},
{
"displayDescription": "Error 'hudson.AbortException: script returned exit code 2'",
"displayName": "Error signal",
"durationInMillis": 13,
"id": "1808",
"input": null,
"result": "FAILURE",
"startTime": "2021-02-16T14:16:25.317+0000",
"state": "FINISHED",
"type": "STEP",
"url": "https://beats-ci.elastic.co//blue/rest/organizations/jenkins/pipelines/Beats/pipelines/beats/pipelines/PR-23966/runs/5/steps/1808/log"
}
]