pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

Pact contains outdates tests data #1683

Open artemptushkin opened 1 year ago

artemptushkin commented 1 year ago

Problem:

Every next Gradle run it appends the test data to pacts files thus whenever you run the pact publish task after it might cause an unexpected pact data publishing.

The expected behaviour would be that the pact files are regenerated from scratch on every tests run hence the pacts would be consistent with the state of tests (pact DSL).

It's very much close to another issue I have opened recently about the report

When I wrote this I realized that's on the Gradle side probably and we should have a custom task to clean before or is it possible to handle it in JVM runtime?

I can create an example if needed.

rholshausen commented 1 year ago

Would the Gradle clean task not be sufficient, rather than a custom clean task?

artemptushkin commented 1 year ago

no, because gradle clean cleans too much and that's not needed in many cases. It should be more grannual