-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pact plugin message contents differ in pact ffi 0.4.6+ (now base64 encoded) #366
Comments
failing and passing ci runs to repro https://github.com/pact-foundation/pact-go/actions/runs/7617794146 |
I've taken a look at the MATT plugin to try and work out what's going on. I thought perhaps I could force the content not to be encoded by explicitly setting Curiously, the
|
I don't see what the issue is. Both forms are valid. |
the client isn't sending or expecting a base64 response, something in Pact, in 0.4.6+ of the FFI is encoding the payload as base64 in the pact. That would be okay, if on the provider side, it decoded the content before sending the request to the provider. Currently that isn't the case, the provider service receives a base64 encoded payload, from the pact verifier, and I don't know if the pact client library (pact-go/pact-js), or the plugin author (Matt in this case), needs to make changes to their code. The fact an end-users test needs to change seems like a code smell |
Ok, that is a different problem. The Pact file has how it has been encoded, and it should be decoded when the Pact is loaded before being used. |
I saw from the cookie trail of commits, that there was a fix put in for v3 contents to decode the body, let me find the commit (this is a v4 pact) |
It must be a plugin issue, I think it passes everything on to the plugin to setup the request to make |
Here is the plugin code for this is the v3 commit |
That commit is for V3 Pacts, this one is V4 |
wasn't sure if it needed to be applied for v4 too, or if that is/was a red herring. I didn't dig into too much, just an eyeball |
So in pact ffi 0.4.5 the key generation was removed, and were no longer stored in the Pact (it was causing issues when uploading Pacts to a broker, and performing comparisons) as part of this commit Related issues
The plugin errors seen here, use a version which was built and relied on FFI 0.3.15 Updating the plugin to solve the issues documented in the OP required
This leaves me with working tests in pact-go and pact-js which utilise this plugin, but leaves open the question in this issue around
But I think once I've applied the update to the matt plugin, and got that rolled out in the pact-go and pact-js example. I can close this ticket and follow it on the other raised issue |
During some testing and upgrading of pact-js/pact-go from 0.4.5 -> 0.4.12 (latest at the time of testing), there is a difference in the Pact content, which is now recorded as base64 encoded. These contents are consumed by the matt plugin 0.0.9
I'm trying to work out if this is intended, and if as plugin authors, we should be considering the
encoded
value and decoding the base64 content before sending it to the system under test. Currently to get the tests to pass, I would have to modify the clients, as they are now receiving base64 encoded content where they aren't expecting it.Cookie trail
0.4.5 Pact
0.4.6 Pact
The text was updated successfully, but these errors were encountered: