Hi Team :wave: , I’ve been seeing some ‘strangenes...
# pact-jvm
a
Hi Team 👋 , I’ve been seeing some ‘strangeness’ in our logs when our Provider Verification step runs in our build. We are using the junit5 Provider annotations, however 1 of our @PactVerifyProvider annotated methods is not publishing any verification - whereas the other 4 provider tests we have in the same class all do. In our build in pass in the following args to the task • pact.provider.version -> git SHA • pact.provider.tag -> branch-name • pact.provider.branch -> branch-name • pact.provider.environment -> env (we have set up DEV/PROD) • pact.verifier.publishResults -> always true • pactbroker.auth.token -> auth token Is there something in the combination of the tags we are sending that could cause this to happen for a single provider? TIA
u
The only thing I can think of, is that it is not being run. The test methods will be run based on what Pact files are fetched from the broker.
a
Thanks @uglyog, could you give me more detail on how these pacts would be retrieved and if there is something available on cli or HAL Browser where I can run this against our broker? Could the flags we use in our verification step impact the pacts that are returned? Specifically, I’m wondering about the environment flag we are using. Would that require the pact to be both published and recorded for it to be returned as a pact that needs verification?
u
None of those affect which Pact files are retrieved, they are used to record the values when the validation is complete. Can you provide your Pact test? Or the logs from the run?
Just checked your logs you sent through to the Smartbear support email. The problem is that the verification is based on the Pact contracts that are fetched from Pactflow, not what is defined in the test class. There is no interaction in the Pacts fetched for verification for
@PactVerifyProvider("PSP Success ➡ Work Order Notification")
, so there won’t be a result for that method.
m
I’m assuming there is output that shows the notices Ron? In Pact JS for example, it prints the notices that says why it has selected a particular pact to verify, e.g.
Copy code
The pact at <https://test.pactflow.io/pacts/provider/e2e%20Provider%20Example/consumer/e2e%20Consumer%20Example/pact-version/9603a4c918997285c6b5230042b3dee3bb776ced> is being verified because the pact content belongs to the consumer version matching the following criterion:
    * latest version from branch 'master' (10.0.1-master+5.ff58e7a.SNAPSHOT.fv-az83-114)
This pact is in pending state for this version of e2e Provider Example because a successful verification result for a version of e2e Provider Example with tag 'master' has not yet been published. If this verification fails, it will not cause the overall build to fail. Read more at <https://docs.pact.io/go/pending>
(via https://github.com/pact-foundation/pact-js/runs/7603983107?check_suite_focus=true#step:4:8034)
u
Yes, it is in the output from the verification build
👍 1
a
The notices that we get back in our verification build are only for the tests that are working. There is no notice provided for the missing Provider.
We also see the contract being published successfully in our consumer repo pipeline
Copy code
Created mfg-work-order-notification version 42d37704d59a3116347156ca05520c5380ecf523 with branch TRF-1901 and tags TRF-1901
79
Pact successfully published for mfg-work-order-notification version 42d37704d59a3116347156ca05520c5380ecf523 and provider mfg-psp.
80
  View the published pact at <https://moo-print.pactflow.io/pacts/provider/mfg-psp/consumer/mfg-work-order-notification/version/42d37704d59a3116347156ca05520c5380ecf523>
81
  Events detected: contract_published, contract_requiring_verification_published, contract_content_changed (first time any pact published for this consumer with consumer version tagged TRF-1901)
I guess what I’m not fully grasping yet is what pacts are returned by the broker when you say ‘Pact contracts that are fetched from Pactflow’. Is this all pacts for the pacticipant or will the result set be filtered by version/tag/branch/environment?
FWIW, I think the issue is somewhere in our process and how we are using the tooling more pact itself.
u
The pacts are filtered by the Provider name, consumer version selectors (if you are using those) and then consumer tags (via pactbroker.consumers property) and then maybe by any of the filter properties (see https://github.com/pact-foundation/pact-jvm/blob/master/docs/system-properties.md)