HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to test a cluster of microservices?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
clustertestmicroserviceshow

Problem

I took a look into Server Spec and it says it clearly:


Remark: serverspec test suites are meant to be run against a single machine (or docker container). In other words, you should not try to issue a single rspec command that would harvest and run tests against multiple machines or containers. You need to issue one rspec command for each of them.

So I can do test per-server, which is good for some cases. But the problem is the following: my microservice architecture has a auto-discovery service, so some services are known after querying it. Is there any project to express this? I know I can tool around with ruby (or python if I choose testinfra or other)

Something integrates with Consul with serverspec or similar will be great, in 2014 people were looking for this, does anyone know of any project that tackled this issue?

Solution

If nothing exists to easily mock Consul, have you considered spinning up a Consul service along with your other microservices? Consul can run in Docker, so this should be fairly straightforward if you use docker-compose and your apps can be configured to point to a different Consul endpoint.

Once your docker-compose is configured to spin up all the infrastructure/microservices required for your test, you will be able to use whatever tools you're familiar with to test your microservices, e.g. Selenium.

Context

StackExchange DevOps Q#731, answer score: 1

Revisions (0)

No revisions yet.