run-cts split output to only colour titles.

Currently the entire block of output gets coloured in the CTS output.
This can lead to giant blocks of red and green on the screen which is
hard to read. This PR changes the output to only colour the title and
leave the message the default colour.

The skip colour of blue was changed to cyan as the blue was showing as
red on my terminal which makes it appear as an error instead of a skip.

Change-Id: Idb4fc053bb83c710871f75b997e1fc3e3fdea695
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87679
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair 2022-04-25 12:15:44 +00:00 committed by Dawn LUCI CQ
parent 90f4939948
commit cc74dc3dda
1 changed files with 4 additions and 2 deletions

View File

@ -806,7 +806,9 @@ func (r *runner) streamResults(wg *sync.WaitGroup, results chan result) {
buf := &bytes.Buffer{}
fmt.Fprint(buf, statusColor[res.status])
if res.message != "" {
fmt.Fprintf(buf, "%v - %v:\n%v", name, res.status, res.message)
fmt.Fprintf(buf, "%v - %v:\n", name, res.status)
fmt.Fprintf(buf, ansiReset)
fmt.Fprintf(buf, "%v", res.message)
} else {
fmt.Fprintf(buf, "%v - %v", name, res.status)
}
@ -908,7 +910,7 @@ var statuses = []status{pass, warn, fail, skip, timeout}
var statusColor = map[status]string{
pass: green,
warn: yellow,
skip: blue,
skip: cyan,
timeout: yellow,
fail: red,
}