From 69e2fc8ba9cb25464130c47dca10ee0162e6e5bd Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Tue, 15 Dec 2020 22:09:07 +0100 Subject: [PATCH] Add TAP header --- pkg/output/tap.go | 5 +++++ pkg/output/tap_test.go | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/output/tap.go b/pkg/output/tap.go index 9803f5f..8ef8563 100644 --- a/pkg/output/tap.go +++ b/pkg/output/tap.go @@ -32,6 +32,11 @@ func tapOutput(w io.Writer, withSummary bool, isStdin, verbose bool) Output { // JSON.Write will only write when JSON.Flush has been called func (o *tapo) Write(res validator.Result) error { o.index++ + + if o.index == 1 { + fmt.Fprintf(o.w, "TAP version 13\n") + } + switch res.Status { case validator.Valid: sig, _ := res.Resource.Signature() diff --git a/pkg/output/tap_test.go b/pkg/output/tap_test.go index 1a8b632..3cce4a2 100644 --- a/pkg/output/tap_test.go +++ b/pkg/output/tap_test.go @@ -36,7 +36,7 @@ metadata: Err: nil, }, }, - "ok 1 - deployment.yml (Deployment)\n1..1\n", + "TAP version 13\nok 1 - deployment.yml (Deployment)\n1..1\n", }, { "a single deployment, verbose, with summary", @@ -57,7 +57,7 @@ metadata: Err: nil, }, }, - "ok 1 - deployment.yml (Deployment)\n1..1\n", + "TAP version 13\nok 1 - deployment.yml (Deployment)\n1..1\n", }, } { w := new(bytes.Buffer)