Hello guys, is the pending pact the feature of the...
# pact-jvm
t
Hello guys, is the pending pact the feature of the broker ? Is there a way to disable pending pact from provider test (as an argument to mvn verify command)? Since I have a mono repo and pact consumer/provider tests only run on merge CI/CD pipeline, at that time all providers and consumers must have valid contracts
y
Hey, It is configured in the providers verification build https://docs.pact.io/pact_broker/advanced_topics/pending_pacts#how-the-feature-is-enabled Can you provide the arguments you are providing in your provider verification?
t
Thank you for your suggestion, i added the pactbroker.enablePending=false to the provider verification command (mvn -DpipelineBuild=true --activate-profiles maven-profile,provider-pact-test -Dpackbroker.scheme=http -Dpactbroker.host=localhost -Dpactbroker.port=9292 -Dpactbroker.auth.username=pact_workshop -Dpactbroker.auth.password=pact_workshop -Dpact.provider.version="7.0.36-$(git rev-parse --short HEAD)" -Dpactbroker.enablePending=false -Dpact.verifier.publishResults=true --projects 60000-demo-service/demo-service --also-make -f all-modules-pom.xml clean verify) but i still see this:
Copy code
Verifying a pact between service2 (7.0.59-SNAPSHOT-e7ce7bb969) and demo-service [PENDING]

  Notices:
    1) The pact at <http://localhost:9292/pacts/provider/demo-service/consumer/service2/pact-version/d7dab96a7ad11995d05396a3b3595fbe44f3cc6f> is being verified because the pact content belongs to the consumer version matching the following criterion:
    * latest version of service2 that has a pact with demo-service (7.0.59-SNAPSHOT-e7ce7bb969)
    2) This pact is in pending state for this version of demo-service because a successful verification result for demo-service 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>

  [from Pact Broker <http://localhost:9292/pacts/provider/demo-service/consumer/service2/pact-version/d7dab96a7ad11995d05396a3b3595fbe44f3cc6f/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT02NyZwPXRydWU>]
  Given contract 1 exists
  get contract 1
13:07:08.292 [main] DEBUG org.springframework.test.web.servlet.TestDispatcherServlet - GET "/v1/contracts?name=Contract%201", parameters={masked}
13:07:08.296 [main] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped to cloud.nakisa.demo.controllers.ContractController#findAll(String)
13:07:08.328 [main] INFO cloud.nakisa.demo.controllers.ContractController - findByName Contract 1
13:07:08.331 [main] DEBUG org.springframework.test.web.servlet.TestDispatcherServlet - Failed to complete request: java.lang.NullPointerException
      Request Failed - Request processing failed; nested exception is java.lang.NullPointerException

Pending Failures:

1) Verifying a pact between service2 and demo-service - get contract 1

    1.1)       Request processing failed; nested exception is java.lang.NullPointerException
u
That flag is only advice to the broker. The broker decides if a Pact is pending or not
t
So the pending feature have to be disabled from the broker?
u
I don't know if it can, but you can try ask in the #C9VPNUJR2 channel