Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose support #8

Open
festo opened this issue Oct 7, 2015 · 8 comments
Open

Docker compose support #8

festo opened this issue Oct 7, 2015 · 8 comments

Comments

@festo
Copy link

festo commented Oct 7, 2015

We have a big project with multiple containers what is connected by Docker Compose.
Is there any possibility to use multiple containers for one test or Docker Compose? Because we don't want to create an all-in-one container.

@tlovett1
Copy link
Owner

Hmm Dockunit.json files describe a number of containers. Am I missing the point?

@festo
Copy link
Author

festo commented Oct 14, 2015

Ok, maybe I was a litle misunderstable. I try to explain it with an example:
There is a Node.js project what use Redis and MongoDB. We have a Dockerfile for the the app, and use default docker containers from Docker Hub for Redis and Mongo.
This contaners are linked in a docker-comppose file and the tests run only in node contaner but it use the others too.

How can I set it in a Dockunit.json file?

@tlovett1
Copy link
Owner

Can you link me to the repo? Docker compose is for running applications. Dockunit is for testing applications.

@festo
Copy link
Author

festo commented Oct 15, 2015

It is just an imaginary example. Our system is way more complex and it is on private repo, but it doesn't matter ...

In travis, if I want a database, I can set a service: http://docs.travis-ci.com/user/database-setup/
The whole test is in a sandbox. I get a clean databases, etc.

In Dockunit.json can I start a docker container in beforeScripts? How I linked it to the main app?

@ruimarinho
Copy link

Interesting, I'm also looking for the same. @festo have you tried docker-compose up -d on beforeScripts?

@tlovett1 basically this would allow us to run start our service dependencies before running the tests, which may require some level of integration (ie. writing to and reading from a database).

@tlovett1
Copy link
Owner

Each docker container is intended to be fully self supporting. Your docker container would contain your DB service and your web server. beforeScripts is run INSIDE a docker container, so you would be running docker compose instead of container which probably won't work.

@tlovett1
Copy link
Owner

@ruimarinho can you give me an example repo?

@nlundquist
Copy link

nlundquist commented Sep 6, 2016

@tlovett1 "Each docker container is intended to be fully self supporting." I think assuming this limits the usefulness of the dockunit design.

Many organizations use one-container-per-service (these containers may be maintained by different teams) and in a complex environment with multiple in-house services you may need to initialize several containers via something like docker-compose before you can test the container of the app in question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants