From 2defae09ad2fe6bab090b6b62de8fdad7a3b1447 Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Mon, 27 Jan 2020 20:45:24 -0500 Subject: [PATCH] Fix Github PR comment formatting (#56078) --- vars/githubPr.groovy | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/vars/githubPr.groovy b/vars/githubPr.groovy index 4c19511bb895..91a4a76894d9 100644 --- a/vars/githubPr.groovy +++ b/vars/githubPr.groovy @@ -106,23 +106,28 @@ def getTestFailuresMessage() { } def messages = [] + messages << "---\n\n### [Test Failures](${env.BUILD_URL}testReport)" - failures.take(5).each { failure -> + failures.take(3).each { failure -> messages << """ ---- - -### [Test Failures](${env.BUILD_URL}testReport)
${failure.fullDisplayName} [Link to Jenkins](${failure.url}) +""" -``` -${failure.stdOut} -``` -
+ if (failure.stdOut) { + messages << "\n#### Standard Out\n```\n${failure.stdOut}\n```" + } ---- - """ + if (failure.stdErr) { + messages << "\n#### Standard Error\n```\n${failure.stdErr}\n```" + } + + if (failure.stacktrace) { + messages << "\n#### Stack Trace\n```\n${failure.stacktrace}\n```" + } + + messages << "\n\n---" } if (failures.size() > 3) {