Hi Guys, I need some general guidance to implemen...
# general
g
Hi Guys, I need some general guidance to implement pact test in my project, i have a bunch of micro services written using spring boot in a product, currently there are unit tests and a lot of E2E tests responsible for testing all functionality, I am trying to use pact and possibly reduce the amount of E2E tests after that. I am confused over the scope of provider side verification tests, whether I should just mock everything beyond controller layer and send a mock response back to verify consumer pact (this approach wouldn't help me in reducing E2E tests) Or run the provider service and mock the outgoing calls and database calls so that all the provider side code gets tested as part of pact verification process (This approach has a bunch of challenges to mock all outgoing interaction points).
b
howdy 🙂 you've basically described the two general provider verification approaches 👌
I would stub a little further in, past the controller layer
🙌 1
j
The approach my team is taking is to mock-out all microservices that the provider service depends on in order to test it in isolation, but we are also spinning up a test instance of its database (via a simple docker container) rather than actually mocking it out, since our microservices generally own their own databases
👍 3
m
Ultimately you just need to consider what tool/approach gets you the coverage you need
👍 1
b
@Gaurav We just went through this process and found the mocking to become so extensive (for a larger GraphQL API) that we pivoted to using SQLite in our pipeline with some seeding scripts to replace the DB mocks (similar to @json above). Its now been 4 months and I think the overall developer experience has improved.
❤️ 1
👍 1