question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pact keeps outdated interactions in contract JSON

See original GitHub issue

See reproduction steps from https://github.com/pkubowicz/pact-merge

I remove an old interaction and define a new one - with a new description, new endpoint, new expected answer. However, the contract JSON on my disk does not reflect what I have in my test - it keeps the removed interaction.

As a workaround, I always clean pact directory to prevent Pact from doing strange things with already existing files:

test {
    doFirst {
        delete pactOutputDir
    }
}

This however has negative performance implications for Gradle, as described in https://github.com/gradle/gradle/issues/6864#issuecomment-423837703

Can this strange ‘merging’ be fixed as a bug, or can I have a system property to disable it?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
uglyogcommented, Apr 21, 2019

Version 3.6.5 has been released

1reaction
uglyogcommented, Apr 19, 2019

Setting the Java system property pact.writer.overwrite to true will now force overwriting the file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pact keeps outdated interactions in contract JSON #804 - GitHub
I remove an old interaction and define a new one - with a new description, new endpoint, new expected answer. However, the contract...
Read more >
Removed old interactions in outputted pact json file
I've managed to get pact contract testing working and it outputs the json file. But it has previous interactions in the json file...
Read more >
FAQ | Pact Docs
Maintainability: Pact is "contract by example", and the examples may involve large quantities of JSON. Maintaining the JSON files by hand would ...
Read more >
Message Pact - Contract Testing In Event-Driven Applications
Pact works great for interactions between services that follow a request-response pattern, for example when using HTTP. However, not all ...
Read more >
@pact-foundation/pact - npm
Implementation of the consumer driven contract library Pact for ... interactions and asynchronous interactions with JSON-formatted payloads.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found