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

Dockerized tests #517

Closed
wants to merge 1 commit into from
Closed

Conversation

avishayp
Copy link

@avishayp avishayp commented Oct 22, 2018

In this PR:

  • Move docker base image to python3-alpine instead of ubuntu.
  • Reduce docker context size with more aggressive .dockerignore
  • Add a service that runs test_httpbin.py to docker-compose.yml

why

I was not able to run tox tests on my mac. I did not dig into that - docker provides more reproducible environment for running unittests.

@javabrett
Copy link
Contributor

Disclaimer: I'm not a collaborator on this project and don't have any say on what gets merged.

Consider decomposing this PR - the main thrust, which is to run tests, should be independent of the Docker base/build changes.

The tests should be run as part of the Docker build, not as a Compose service, e.g.:

diff --git a/Dockerfile b/Dockerfile
index 6e391a6..6b4da16 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -11,6 +11,7 @@ EXPOSE 80
 
 ADD . /httpbin
 
-RUN pip3 install --no-cache-dir gunicorn /httpbin
+RUN pip3 install --no-cache-dir gunicorn /httpbin && \
+    python3 /httpbin/test_httpbin.py

... or perhaps better, arrange for the equivalent of python3.6 setup.py test as mentioned in #448.

@kennethreitz
Copy link
Contributor

let's break this out, keep the image the same for now

@avishayp
Copy link
Author

Replaced with #520 as requested.

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

Successfully merging this pull request may close these issues.

3 participants