hello, any pointers on how to analyze a pactflow b...
# pactflow
a
hello, any pointers on how to analyze a pactflow broker message for the provider contract "source sequence is illegal/malformed utf-8" with a error reference code
running the cat file command and decoding it on my machine seems to create utf-8 files, but on macos I am running it locally without the -w0 flag
y
Hi @Anja Gruss You can use our CLI tool now which will base64 the file for you - tracking it here https://github.com/pactflow/roadmap/issues/68 which you can use this like https://github.com/pactflow/example-bi-directional-provider-postman/pull/13 I will be updating the docs this week.
Just tested this out now 👍 so should work for you 🤞
Copy code
docker run --rm -v /${PWD}:/${PWD} \
    -w ${PWD}  \
   -e PACT_BROKER_BASE_URL \
   -e PACT_BROKER_TOKEN \
    pactfoundation/pact-cli:latest pactflow publish-provider-contract \
      oas/swagger.yml \
      --provider "pactflow-example-bi-directional-provider-postman" \
      --provider-app-version 152b2ac \
      --branch test-pactflow-command \
      --content-type application/yaml \
      --verification-exit-code=0 \
      --verification-results newman/newman-run-report-2022-06-09-12-20-39-465-0.json \
      --verification-results-content-type text/plain\
      --verifier postman
can you provide any output from your CI logs, or where you are getting the error
a
I will try it with the CLI thingy first, and then get back to you, thanks!
m
Have you got the error reference code Anja?
If you can share the code here (or send to support@pactflow.io with that code) we can see what happened on this side of the fence and (hopefully) pinpoint the issue
I think we did see some issues the other day, where it looked like some fields (such as the provider name) were not populated correctly and instead had some sequence of
%
and spaces etc. in it.
a
@Matt (pactflow.io / pact-js / pact-go) it was BocUnPiQOm
@Yousaf Nabi (pactflow.io) I just realized that the pact image that is used at the client uses the ruby gem install
Copy code
RUN gem install pact pact_broker-client pact-mock_service pact-message
and then copies some custom scripts (can-i-deploy, pact-publish...) how would we add the publish-provider-contract in this scenario?
y
pact_broker-client latest will have a
pactflow
binary, the command is listed on the readme and website
Copy code
pactflow publish-provider-contract \
      oas/swagger.yml \
      --provider "pactflow-example-bi-directional-provider-postman" \
      --provider-app-version 3a0994c \
      --branch test-pactflow-command \
      --content-type application/yaml \
      --verification-exit-code=0 \
      --verification-results newman/newman-run-report-2022-06-09-14-00-55-366-0.json \
      --verification-results-content-type text/plain\
      --verifier postman
after installing the gem
gem install pact_broker-client
👍 1
a
hm, so currently I fail with an error for the verification-results path, and cannot find a good hint about this variable
m
what’s the error Anja?
Regarding your previous error (thanks for sharing the error code), I’m seeing
source sequence is illegal/malformed utf-8
in the logs.
hm, so currently I fail with an error for the verification-results path, and cannot find a good hint about this variable
this should be a path to a file, containing verification results for the provider test (the test that checks an OAS is compliant with the actual provider).
a
is there any documentation on this? when and how is that file created? and by who?
sorry, still very new to the bi-directional thing
m
no problems!
The publishing docs are here (courtesy of Yousaf): https://docs.pactflow.io/docs/bi-directional-contract-testing/contracts/oas#publishing This is the bit that I think you’re asking about
a
so this is basically the result of https://docs.pactflow.io/docs/bi-directional-contract-testing/provider step 2 in this document?
m
Yes! Choose tool, test your provider, share the provider test output+OAS to Pactflow
How are you testing the provider? Or, separately, are you generating the OAS (e.g. from spring/code)?
a
the OAS is generated by springfox, and currently there is no test yet -.-
m
Perfect, so for now, we just need a dummy file (e.g. an empty text file that says “generated by springfox”). I think it’s a mandatory property.
a
ok, I could upload it successfully \o/
🎉 2