Brazao
04/05/2022, 5:48 PMLewis Prescott
04/06/2022, 7:23 AMMatt (pactflow.io / pact-js / pact-go)
Jhonata Ramos Bezerra
04/06/2022, 12:28 PMMatt (pactflow.io / pact-js / pact-go)
Jhonata Ramos Bezerra
04/06/2022, 1:27 PMJhonata Ramos Bezerra
04/06/2022, 1:28 PMRicardo Cruz
04/06/2022, 10:03 PMJhonata Ramos Bezerra
04/07/2022, 10:46 AMMatt (pactflow.io / pact-js / pact-go)
1. We saw that in the tests the integration is only published by the Consumer, is this configurable, or does the tool always require a Consumer driven contract testing?Pact is only a consumer driven contract testing tool. The docs at http://docs.pact.io/ primarily talk about consumer driven contract testing with Pact. Pactflow has a feature called bi-directional contract testing, which supports provider driven and other workflows. Both are explained over here at Pactflow University: https://docs.pactflow.io/docs/workshops
2. We analyzed the Pactflow sample projects and noticed some differences between the JavaScript and DotNet samples. For DotNet the data of “PROVIDER VERSION” is not filled. Is this configurable or is it a limitation of the tool?I’m not sure what this means sorry. Could you please elaborate? Pact JS and Pact .NET will have differences to reflect the various languages, so it’s possible they set the version in slightly different ways. The provider version is an important concept though, and is critical to CI/CD workflows and tools like can-i-deploy.
3. Is there some sort of “strict” or “loose” validation for the tests?
Note:
- Strict: Ensures that each definition for the API under test is equivalent to the API code. Can be used to test each existing endpoint.
- Loose: The loose validation mode ensures that every information set in the contract test is equal, but if there are more endpoints or properties, the contract is not broken.I’d suggest watching the introductory videos in the docs shared above, this migth help clarify. But regarding “strict” or “loose” - that depends on the perspective. In BDCT and CDC a consumer can’t request something the provider doesn’t have - that will always fail. If the consumer only uses a subset of the provider, that will be fine also. This is down to the field level. With Pact, you can be strict or loose based on data types - you can match only exact values, or use matchers. With BDCT it only ever does a schema comparison (so it’s “loose” by a different definition)
4. How exactly should Middleware work in the Provider scenario?I’m not sure what you’re asking here. The provider should run locally, and if it has middleware, it should run also.
5. About body. I’m facing this “ParserError” but when I call directly my API the request is ok (As shown in the example in the attached images or in the images below).This looks like a specific problem with your test. At a glance, I can’t see why, My suggestion is to create a reproducible example and raise on the Pact .NET github issues so the maintainers of that project can assist you. This being said, if you’re new to Pact, you should use the latest 4.x.x library (currently in beta). It will save you re-work in the future. Cheers, Matt
Slackbot
04/08/2022, 3:55 AM