Greetings. I came across a weird bug using the pa...
# pact-php
p
Greetings. I came across a weird bug using the pact php package to verify the interactions with another service that acts as a consumer. Oddly, when I call "verify('devices-gateway')" on the Verifier, it's verifying another interaction with another consumer service, which is verified with a MessageVerifier in another unit test of the same provider. It seems to be verifying the accurate consumer right at the start of my unit test, but it's abruptly ending, as these two lines of log show;
Copy code
[2023-04-05T11:57:37.873381-04:00] console.debug: Process command: /app/vendor/pact-foundation/pact-php/src/PhpPact/Standalone/Installer/../../../../pact/bin/pact-provider-verifier https://[PACTBROKER_URL]/pacts/provider/oauth-service/consumer/devices-gateway/latest/ --provider='oauth-service' --provider-base-url=<http://0.0.0.0:7202> --provider-app-version=1.0 --broker-username=[USERNAME] --broker-password=[PASSWORD] --enable-pending --include-wip-pacts-since=2020-01-30 --pact-broker-base-url=[PACTBROKER_URL] 

[] []
[2023-04-05T11:57:39.443766-04:00] console.debug: Exit code: 1 [] []
It then moves on to the other verification, even though I really mentionned "->verify('devices-gateway')" in my unit test, right before my final assertion. I was wondering if there's anything being cached or something. When I first developed this verification unit test, I wrongly used the "verifyAll" function on the verify all, so I wonder if there's some kind of black magic going that's I'm not aware of. Thanks for helping.
m
Ah, you might be running into an issue with the V2 spec, where you can’t verify both HTTP and non-HTTP (aka messages) in the same verification process. The verifier will fetch all pacts/consumers and verify them, and this is not supported in V2. In V4 this is fixed, but Pact PHP does not yet support that
the fix is to name the provider differently for HTTP and Message verifications
❤️ 1
1
p
This is exactly what was going on. And this is what we ended up going for; naming the provider differently. We're still happy to know the problem wasn't in our implementation. Thanks for the quick answer.
🙌 1