Message Provider Validation against Pact Broker Wrongly Succeeds
See original GitHub issueI have a strange behavior during message provider verification.
I successfully published a message pact to my test pact broker instance (v 2.26.0, hosted by you, if it helps 😉). When viewing the message pact in the pact broker, it says Note: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.
and only shows the JSON.
When I run my provider test, it succeeds, even though my message provider returns an invalid message.
When I run the provider test against a local pact file instead, it fails, as I would expect.
Maybe the verifier doesn’t find the pact on the broker (because the broker does not support message contracts) and since it hasn’t found a pact, it just succeeds? If this is the case:
- I would expect the verifier to fail if it doesn’t find any pacts to test against.
- when will the pact broker support message contracts? 😉
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Message Provider Validation against Pact Broker Wrongly ...
I have a strange behavior during message provider verification. I successfully published a message pact to my test pact broker instance (v ...
Read more >FAQ | Pact Docs
During pact verification, Pact does not test the side effects of a request being executed on a provider, it just checks that the...
Read more >Regarding pact provider test - Stack Overflow
I am using working on the contract testing in nodejs using pact, ... see a message "INFO: Publishing verification result [success: true, ...
Read more >stub - Pactflow Documentation
The focus on the messages (request/response), not the implementation. ... Use the pact generated by the unit tests along with a pact stub...
Read more >Consumer-driven contract testing with Pact - codecentric Blog
The next step is to execute the provider tests against your Pact file. If the provider verification is successful it means that the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, so if you turn on debugging you might get more of an indication as to what is happening. It looks like “latest” is not a tag (also you shouldn’t tag anything
"latest"
, I think it’s documented somewhere…, but mainly becauselatest
is a special case in the broker, see below).Although it’s not a tag, it’s tricking Pact Node by not returning a
40x
type error when it goes to find relevant pacts. But when it invokes the verification process, it doesn’t yet have a Pact and fires off the command omitting some key properties - e.g.With the correct tags, you’ll see it adds a bunch more:
By omitting the
latest
tag it will, ironically, automatically pick up the latest pact. I’ve happened to tag this pact asprod
and so searching for that tag also works.So this is definitely a bug, and the bug is in
pact-node
. I’ll move the issue and get it fixed - thanks for the report!I think this issue is resolved now @thombergs - can you please confirm?