Automattic / a8c-ci-toolkit-buildkite-plugin

A caching plugin that can be invoked from your build script.
22 stars 5 forks source link

Omit block for test failure details in annotation when there's none #63

Closed mokagio closed 1 year ago

mokagio commented 1 year ago

Not all test nodes failures in the JUnit report have a value.

E.g. from the failures in this build:

<testcase classname="StatsTests" name="testInsightsStatsLoadProperly()" time="131.52018702030182">
  <failure message="failed: caught error: "timedOut" (#CharacterRangeLen=0)"> </failure>
</testase>

In such cases, the failure annotation looks a bit odd:

image

The changes in this PR make the annotation look like this:

image


mokagio commented 1 year ago

We've been wondering with how to best test these changes and other changes. See internal ref p1685981991334859-slack-C02KLTL3MKM

It's crucial for the long term health of this project that we find an answer. However, I think the scope is broader than this PR and therefore I'm going to merge in the meantime to roll out the improvement.

On that note, I had a play around and have a proof of concept for using RSpec to test part of the code edited here: #64