Microservices testing: how do you test interactions between services?
Anna Okonkwo
·155 views
testing interactions between microservices is a constant challenge for us. unit tests are great, but they don't catch integration issues. we're using a mix of strategies: contract testing with pact, integration tests that spin up real services in docker compose, and occasionally mocking external dependencies. our ci pipeline currently takes 45 minutes to run integration tests for just 8 services, which is getting prohibitive.
the balance between test coverage and feedback speed is always difficult. contract testing helps ensure compatibility, but it doesn't test the actual business logic of the integration. spinning up real services gives confidence but is slow and resource-intensive. service virtualization seems promising, but it adds another layer of abstraction and maintenance.
what's your pragmatic approach to testing microservice interactions? how do you ensure sufficient coverage without slowing down development or making ci intractable? are there specific tools or frameworks that have significantly improved your integration testing story?
4 comments