pact-ruby: Cannot publish verification for "" as not all interactions have been verified

Hi

I am running into an issue where I am constantly hitting the following warning when publishing pact verifications

WARN: Cannot publish verification for PetStore as not all interactions have been verified. Re-run the verification without the filter parameters or environment variables to publish the verification.

The service provider is a standard ruby application using a setup like the following.

    consumer_version_tags [
      { name: 'production', all: false, fallback: 'master' },
      'master'
    ]

The consumer is a Javascript application and we are using pact-broker to share pacts.

What I think is happening is when the “production” and “master” tag point to the same commit sha# pact only verifies one lot of tags and is then failing to publish with the incomplete warning…

The following shows both pacts are for the same consumer version (I have slightly redacted the log)

INFO: Fetching pacts for PetStore from * for tags: latest production (or master if not found), latest master
INFO: Reading pact at /pacts/provider/PetStore/consumer/PetStore-Web/version/4aeec9b870979a8a8b66108f7382669b85556796
INFO: Reading pact at /pacts/provider/PetStore/consumer/PetStore-Web/version/4aeec9b870979a8a8b66108f7382669b85556796

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 34 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Ok, the thing that was causing the issue was that when you verify a pact with the same URL twice, the number of interactions in this pact is equal to n, and the number of executed interactions that came from this pact URL was n * 2. Because publishable? was checking for equality, these two obviously didn’t equal each other. I was never able to reproduce it because I was using the new ‘pacts for verification’ API that deduplicates the pacts before they even reach the client. This is why the problem didn’t exist in the example I set up.

I’ve updated the logic in the pact gem to be smarter about how it checks if all the interactions have been run (it now checks that each interaction has an example associated with it, rather than doing a count) so the latest pact gem will work with the old broker.

I do recommend upgrading your broker though, as the new ‘pact for verification’ API will give you some cool new features.

https://docs.pact.io/pact_broker/advanced_topics/provider_verification_results#pacts-for-verification