Hello o/ we have pact net running in necoreapp2.1,...
# pact-net
d
Hello o/ we have pact net running in necoreapp2.1, (tested with PactNet 3.0.2 and 2.6.1). The main problem that we are facing is that pacts show up in pact-flow as unverified, (with the contents of the pact indicating that verification on the individual contracts did in fact ran), while pactnet runner (xunit) pact verifier DOES NOT assert the test and does not mark a unit test as failed when in fact pacts did not verify successfully. Can someone please advise me on what could be the cause of this behavior. Thanks
@Matt (pactflow.io / pact-js / pact-go) Hi o/ thanks for getting back. I have followed the tutorial on the pact net website and pretty sure it logically matches the example. will share the project here shortly
👍 1
I got our pactnet project isolated from the internal sources so you can check it out in this git repo.
Copy code
<https://nibnz.pactflow.io/pacts/provider/nibnz-nib-api/consumer/nz-provider-portal/version/0.1.0-13-g8dbc98b?verification=%2Fpacts%2Fprovider%2Fnibnz-nib-api%2Fconsumer%2Fnz-provider-portal%2Fversion%2F0.1.0-13-g8dbc98b%2Fverification-results%2Flatest>
as an example this interaction. all interactions failed, which I do expect at this stage. however PactVerifier in PactVerifyTests does not fail a unit test. I did observe the same behavior on dotnet 3.1 too btw.
m
Thanks for this Dmitry
It looks OK to me, one guess is that
enablePending: false
is not set, and perhaps .NET is defaulting it to true or empty, which might be interpreted as enabled by default
If you could please share a debug log output (terminal and verifier logs) that might help confirm that
Given it may have sensitive info, please send to support@pactflow.io if you’re uncomfortable sharing here
d
running locally I can only find verification logs of some sort
m
Ah, it should print out in your terminal also what is going on. When you integrate with Pactflow/Pact Broker, it should print out notices of what pact is being verified and why (and if it’s pending etc.)
nothing coming out?
It looks like you have a
MessageSink
setup (so it’s probably in there, wherever there is 🙂 )
d
am ye OK makes sense I will get back to you once I get hold of these thanks
git it
oh right I see this is something that pact consumers control
how do I disable pending in pactnet? I can't see a reference to corresponding API anywhere
m
It’s an option on the verifier config (see link I posted above)
but yes, thanks for providing - that definitely shows it’s using Pending pacts
d
turning this on or off does not seem to make any difference
I know we are using an older version of pact, I don't think I can go higher then 2.6.1 because of our netcore2.1 issue. I wonder if it might be contributing to the problem
m
hmm interesting, could be
at DEBUG level, we should be able to see the calls to the pacts for verification endpoint
it might be that setting it to
false
ignores the property, but we need it to be sent to Pactflow for it to be disabled
ok yes, it looks to be quite old version of the verification call
d
morning Matt o/ yes, unfortunately I had to downgrade because I had issues with missing assemblies when using pactnet with netcore2.1
I made a case in business to block this work until we upgrade notcore version of our API. if that does not fix it we will be in touch, not sure when, hopefully wont have to. Thank you for your time o7
👍 1