diff --git a/.travis.yml b/.travis.yml index a587362..db47f9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ -language: python -script: | - ./setup.py install - pip install -r requirements-dev.txt - nosetests +sudo: required +services: + - docker +script: ./test.sh diff --git a/Dockerfile b/Dockerfile index 994a385..de5dc8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ MAINTAINER github.com/banga/powerline-shell ENV USER docker ENV USERNAME "Docker User" -# Create a 'docker' user because we might not want to run everything as 'root'. Use 9999 as the ID +# Create a 'docker' user because we do not want to run everything as 'root'. Use 9999 as the ID # to keep it specific and away from the IDs in the host system. RUN addgroup -g 9999 $USER && \ adduser -u 9999 -G $USER -g "$USERNAME" -s /bin/bash -D $USER @@ -33,7 +33,8 @@ RUN bzr whoami "$USERNAME <$USER@example.com>" && \ COPY . ./ USER root -RUN chown -R docker:docker . +RUN ./setup.py install && \ + chown -R docker:docker . USER docker -RUN nosetests +ENTRYPOINT ["/bin/sh"] diff --git a/README.md b/README.md index e3ae228..479e220 100644 --- a/README.md +++ b/README.md @@ -256,8 +256,10 @@ Make sure you introduce new default colors in `themes/default.py` for every new segment you create. Test your segment with this theme first. You should add tests for your segment as best you are able. Unit and -integration tests are both welcome. Run your tests with the `nosetests` command -after install the requirements in `requirements-dev.txt`. +integration tests are both welcome. Run your tests by running the `test.sh` +script. It uses `docker` to manage dependencies and the environment. +Alternatively, you can run the `nosetests` command after installing the +requirements in `requirements-dev.txt`. ## Troubleshooting diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..82151d3 --- /dev/null +++ b/test.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +docker build -t powerline-shell . +docker run --rm -it powerline-shell -c nosetests