From bc1058b87d7011966442ea9c1a8f6431b055fbed Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Mon, 27 Jan 2020 22:12:22 -0500 Subject: [PATCH] Fix Github PR comment formatting (#56078) (#56093) --- vars/githubPr.groovy | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/vars/githubPr.groovy b/vars/githubPr.groovy index 4c19511bb8953..91a4a76894d94 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) {