Commit 5f12bb9
authored
feat(provider): add SoftFail mode for downstream-gated verification (#580)
Callers that have a downstream authoritative gate (e.g. a Pact Broker
can-i-merge / can-i-deploy check) want verification mismatches to be
recorded to the broker and reported in the test framework, but NOT to
fail CI locally — the downstream gate makes the real decision.
Previously the only way to suppress local failure was at the shell
layer (turning off pipefail around `go test`), which also silenced
verifier panics, broker auth failures, and any other infrastructure
problem. That made "tests didn't actually run but CI is green" a
common failure mode.
New behavior — `VerifyRequest.SoftFail` (default false, preserves
existing behavior):
- SoftFail = false (default):
err == nil → subtest PASS
err != nil → subtest FAIL (t.Error)
- SoftFail = true:
err == nil → subtest PASS
ErrVerifierFailed → subtest SKIP (t.Skipf, message preserved)
any other err → subtest FAIL (t.Error)
Infrastructure errors (ErrVerifierFailedToRun, panics, broker auth)
always fail the subtest, regardless of SoftFail — they signal the
verifier could not produce a result for the downstream gate to act on.
The discrimination uses `errors.Is(err, native.ErrVerifierFailed)`,
which leverages the mutual-exclusivity invariant of the two verifier
sentinels documented in #579.1 parent 6f25926 commit 5f12bb9
2 files changed
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
179 | 190 | | |
180 | 191 | | |
181 | 192 | | |
182 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
183 | 205 | | |
184 | 206 | | |
185 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
115 | 132 | | |
116 | 133 | | |
117 | 134 | | |
| |||
0 commit comments