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

Add basic tests #13

Closed
chorrell opened this issue Apr 2, 2015 · 6 comments
Closed

Add basic tests #13

chorrell opened this issue Apr 2, 2015 · 6 comments
Labels

Comments

@chorrell
Copy link
Contributor

chorrell commented Apr 2, 2015

Test image builds, and ideally, basic commands. Ideally this help us catch issues before making a pull request to the official image repo.

A recent example of where we got burned by this: docker-library/official-images/pull/630

@tianon
Copy link
Contributor

tianon commented Apr 2, 2015

@chorrell
Copy link
Contributor Author

chorrell commented Apr 3, 2015

Yes! I've been looking at that and was thinking about setting up a Jenkins job to run the tests after a git push. Some basic tests of npm would be good too (npm install foo, npm install -g foo, etc).

@tianon
Copy link
Contributor

tianon commented Apr 24, 2015 via email

@chorrell
Copy link
Contributor Author

I have a prototype/demo test suite for node:0.12: https://github.com/chorrell/docker-node/tree/serverspec-testing.

It uses the serverspec gem and the docker-api gem. If you have bundler already installed, the gems can be installed with:

cd test; bundle

If you have docker running, and those gems installed, you just run the tests with:

cd test; rake

That will build the 0.12 image(tagged as node:0.12), run tests against a container, then delete the image. I've been running this on my Mac with boot2docker. Works pretty well so far.

The tests are very simple at this point, and I'm not testing all the variants (like on-build etc) but this looks really promising and something that could easily be run via Jenkins for pull requests and such.

@retrohacker
Copy link
Contributor

Cross posting from nodejs/docker-iojs#46


So far, I've created a tool for automated testing of Docker images: https://github.com/wblankenship/dante

And put together some smoke tests for the Docker image, which follows the work of rvagg: https://github.com/wblankenship/docker-iojs/blob/tests/tests/iojs/Dockerfile

These tests are executed according to the inventory file here: https://github.com/wblankenship/docker-iojs/blob/tests/inventory.yml

The tests currently do not run the Node.js project's test suite, which may be a good idea.

We have an open pull request for the build group to provision us a Jenkins server that we can wire this workflow up to: nodejs/build#168

The Jenkins slave should trigger the test on a new PR to this repo. The test is run by simply calling dante in the base of the project directory. If the tests pass, dante will exit with a status 0, else it will exit with a status of 1. dante creates tagged images for each build for historical reference. This will chew up HDD space over time so we will need some sort of garbage collection as well.

@chorrell
Copy link
Contributor Author

chorrell commented Apr 4, 2016

TIL that Travis-CI can do a simple build test for us (by running ./test-build.sh) by running a Docker image builds.

I did a test over here:

And it pretty much works as expected. I think for a simple build test that should be sufficient and we can explore some deeper testing later.

So next step is to get Travis-Ci enabled for this GitHub repo.

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

No branches or pull requests

3 participants