diff --git a/master/custom/discord_reporter.py b/master/custom/discord_reporter.py index 4802e037..893f2594 100644 --- a/master/custom/discord_reporter.py +++ b/master/custom/discord_reporter.py @@ -23,15 +23,9 @@ MESSAGE = """\ :warning: **Buildbot failure** :warning: -The buildbot **{buildername}** ({tier}) has failed when building commit {sha}(https://github.com/python/cpython/commit/{sha}). +The buildbot **{buildername}** ({tier}) has failed when building commit [{sha:.12}](https://github.com/python/cpython/commit/{sha}). -You can take a look at the buildbot page here: - -{build_url} - -``` -{failed_test_text} -``` +[Jump to the build page.]({build_url}) """ @@ -159,9 +153,12 @@ def createReport( builder["builderid"], build["number"] ), sha=sha, - failed_test_text=logs.format_failing_tests(), ) + failed_test_text = logs.format_failing_tests() + if failed_test_text and failed_test_text.strip(): + message += "\n```\n{}\n```\n".format(failed_test_text) + payload = {"content": message, "embeds": []} return self._http.post("", json=payload)