7

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?

  • 1
    I think you are misunderstanding run on a single instance (whatever the external needs are) with testing multiple instances within the same run. – Tensibai Mar 30 '17 at 21:12
  • 2
    How are your microservices hosted? Docker Containers? – Richard Slater Mar 31 '17 at 10:03
  • My microservices are running in VMs and some of them in Physical Machines (we do genetics, so there is some on-prem clusters next to sequencers) – nicocesar Mar 31 '17 at 11:38
  • I have found this article helpful if anyone has time to make use of it. toptal.com/nodejs/nodejs-guide-integration-tests – avi Apr 2 '17 at 17:18
  • 2
    Please clarify on type of testing you're looking for, there are different approaches to address system/integration testing of server configuration using for example ServerSpec or KitchenCI, or testing that microservice is up and running using simple HTTP request that each microservice should implement, and different in nature end-to-end application testing can be whitebox/blackbox using for example BDD automation test frameworks or Selenium. – rombob Jun 21 '17 at 13:28
2

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.

1

I like SaltStack because the configuration management provides node testing if you want in the states, per node, and the results are coalesced in the job status and fully accounted for in the returners.

SaltStack states also allow you to generate events on successes or failures, and it allows nodes to advertise (mines) arbitrary endpoint data (ie. which ip:port is it listening on), available to other nodes' configuration states.

The combination of the two gets you what you probably want from Consul.

  • How does it compare to consul in term of service availability ? If one node of a dependent service has fall in OOM 3 hours after your salt job returned, how would you remove this node from the service cluster and avoid your deploying job to call it ? I think the last line is absolutely out of scope. – Tensibai Oct 26 '17 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.