Continuous integration testing that relies on other services


#1

We have a straight-forward use case:

A node application, with a set of integration tests that require presence of a local service that is provided out-of-the-box as a Docker image by a third party.

Ideally we’d:

  • Build a docker executor based on a node image to automatically pick up all those basic requirements.
  • Install docker and docker-compose.
  • Fetch the docker image for the third-party service.
  • Launch it with docker-compose (mapping those ports to our local ports).
  • Run npm test.

Unfortunately this isn’t easy to do using the standard Circle CI configuration. From what I’ve gleaned you can either use machine, installing everything that would be done for you typically via the node image, and then doing the above; or using docker, which would mean, it appears, creating a docker image just to exist along side the service image, and then kicking off the test. But here we’d basically have to take all the current commands in the circle.yml for our service and translate them into commands or Dockerfile entries/settings.

Is there a more elegant solution out there? We have several ideas but want to avoid building something special for this one case.

Thanks.


#2

Is the third-party image an HTTP API? If so, I imagine you could run this in Docker and keep everything else the same, you’d just have to point your tests to the docker container DNS name.


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.