Closed udf2457 closed 2 months ago
Thanks for suggesting Pact for integration testing in egoscale! I appreciate you bringing this valuable tool to our attention.
While I see the overall advantages of Pact, integrating it directly into the egoscale repository (which primarily focuses on Go bindings generated from the OpenAPI spec) might not be the most suitable approach.
Here's my reasoning:
Focused Scope: egoscale's core purpose is providing Golang bindings for consuming the Exoscale API. Adding Pact would deviate from this central functionality.
Modular Testing: Pact excels at contract testing between API providers and consumers. However, for unit testing within egoscale, mocking frameworks like go-mock
or testify/mock
might be more efficient, if you want to use it on your own (we already using it for some project using egoscale).
Now, considering a specific use case of acceptance testing, there's an alternative approach to explore:
Leveraging HTTP Replay for Acceptance Testing:
Our team has been investigating the possibility of using an HTTP replay library for acceptance testing in the Exoscale Terraform provider. This approach would involve recording real interactions with the Exoscale API and replaying them during tests. It offers several benefits:
While we're currently focusing on HTTP replay for the Terraform provider testing, we'll definitely keep Pact in mind for potential future use cases within our project.
Thanks again for bringing this interesting tool to our attention!
What feature would you like to have in egoscale?
See https://github.com/pact-foundation/pact-go + https://docs.pact.io/faq/convinceme
This could be useful both for those at exoscale developing the API, as well as users who are coding against the API.