Tom Linford
09/16/2024, 4:22 PMpact-provider-verifier
--consumer-version-selector "{\"mainBranch\":true}"
--consumer-version-selector "{\"deployedOrReleased\":true}"
--enable-pending
...
We have a consumer for which we have never successfully verified their pact, making the pact we have with them "pending". When we run provider verification, the failures are correctly suppressed because of the --enable-pending flag.
Today a new version of this consumer's pact was published to their main branch with a new request matcher rule in one of the interactions:
"path": {
"combine": "AND",
"matchers": [
{
"match": "regex",
"regex": ".*([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2}).*"
}
]
}
However, in their request they do not provide a path, meaning that the regex will never match.
When we next ran provider verification as part of our CI/CD, this exception was thrown by the pact-provider-verifier and caused our build to exit and fail:
.../pact/lib/vendor/ruby/3.3.0/gems/pact-support-1.20.0/lib/pact/term.rb:32:in `initialize': Value to generate "" does not match regular expression /.*([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2}).*/ (Pact::Error)
from .../pact/lib/vendor/ruby/3.3.0/gems/pact-support-1.20.0/lib/pact/matching_rules/v3/merge.rb:105:in `new'
from .../pact/lib/vendor/ruby/3.3.0/gems/pact-support-1.20.0/lib/pact/matching_rules/v3/merge.rb:105:in `handle_regex'
from .../pact/lib/vendor/ruby/3.3.0/gems/pact-support-1.20.0/lib/pact/matching_rules/v3/merge.rb:91:in `wrap'
...
Is there some reason why this exception was not caught and suppressed? The issue is with the request, which we (as the provider) have no control over.
Any advice would be appreciated! 😄Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
However, in their request they do not provide aMmm, that may be a bug in the generating library!, meaning that the regex will never match.path
Yousaf Nabi (pactflow.io)
Tom Linford
09/17/2024, 12:40 PM