From ad9fe09e70cbf506ec7689858dbba1baba22fc6e Mon Sep 17 00:00:00 2001 From: Matt Fellows Date: Mon, 20 Jan 2020 17:16:16 +1100 Subject: [PATCH] feat(pending): support initial pending pacts implementation --- dsl/pact.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dsl/pact.go b/dsl/pact.go index 4eef65f72..5b789e8b8 100644 --- a/dsl/pact.go +++ b/dsl/pact.go @@ -412,9 +412,16 @@ func (p *Pact) VerifyProvider(t *testing.T, request types.VerifyRequest) (types. for _, example := range res.Examples { t.Run(example.Description, func(st *testing.T) { st.Log(example.FullDescription) + if example.Status != "passed" { - t.Errorf("%s\n%s\n", example.FullDescription, example.Exception.Message) + if strings.Contains(example.FullDescription, "[PENDING]") { + t.Logf("NOTICE: This interaction is in a pending state because it has not yet been successfully verified by %s. If this verification fails, it will not cause the overall build to fail. Read more at https://pact.io/pending", p.Provider) + t.Logf("%s\n%s\n", example.FullDescription, example.Exception.Message) + } else { + t.Errorf("%s\n%s\n", example.FullDescription, example.Exception.Message) + } } + }) }