Make travis use docker and update readme.

This commit is contained in:
Arun Allamsetty 2017-10-04 16:07:44 -06:00
parent 19a913c108
commit dcfa23dedd
4 changed files with 16 additions and 10 deletions

View file

@ -1,5 +1,4 @@
language: python
script: |
./setup.py install
pip install -r requirements-dev.txt
nosetests
sudo: required
services:
- docker
script: ./test.sh

View file

@ -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"]

View file

@ -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

4
test.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
docker build -t powerline-shell .
docker run --rm -it powerline-shell -c nosetests