Closed jeff-hull-ultimate closed 2 years ago
The simplest solution is to delete the pact file(s) before running the tests. The issue you mentioned is a local issue, not in the broker. The way the message process works is a bit different to HTTP Pact, so that write mode is not possible.
Are you sure you're not publishing a folder where the old pact files exist? How are you publishing to the broker?
My guess is that there was a folder where you were writing the pact files to and the old pacts are still there, and your publish script is eagerly uploading everything in the folder.
Yes, we've seen this issue in the past, and it has come around because the workspace was not cleared before running the pact tests.
Thanks for the super fast response, not cleaning the workspace was indeed the issue. An internal helper library was storing the files outside of the project folder, so that obscured it. Thanks again!
No worries!
Software versions
Expected behaviour
New pacts are created for a consumer, and old pacts that were deleted (via 'delete integration') don't come back.
Actual behaviour
Sometimes, I need to delete certain messages from a pact. However, as it stands, say I have 10 messages in a pact. If I delete one, I expect to then have 9 messages in the pact. Yet the 10th message remains. I tried to set
pactfileWriteMode
tooverwrite
, but due to this issue, I'm not able to use theoverwrite
option.I thought if I deleted the pacts manually through the UI and then recreated the pacts, the pacts would then be the new version. But I was surprised to see not only were all old fields present in the pact being updated, previously deleted providers for that consumer were recreated as well. For instance, if I delete all 3 pacts for
tch-doc-query
, and then recreate just the messages for thetch-doc-cmd
, the pacts fortch-doc-cmd2
andtch-storage-worker
somehow come back to life.Steps to reproduce
I can provide some code snippets if would be helpful to diagnose. Currently, the code is in a private repository.
Relevant log files