Skip to content

Commit

Permalink
Add docker image testing (#193)
Browse files Browse the repository at this point in the history
This adds a travis stage to add docker container testing using
docker-compose.

Signed-off-by: David Brown <dmlb2000@gmail.com>
  • Loading branch information
dmlb2000 committed Feb 6, 2019
1 parent e685352 commit 1efb34a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ addons:
stages:
- lint
- test
- test-docker
- deploy
env:
NOTIFICATIONS_URL: http://127.0.0.1:8080
Expand Down Expand Up @@ -73,6 +74,23 @@ jobs:
- script: *1
before_script: *2
python: 2.7
- stage: test-docker
sudo: required
python: 3.6
services:
- docker
script: >
docker-compose build --pull;
docker-compose up -d;
MAX_TRIES=60;
HTTP_CODE=$(curl -sL -w "%{http_code}\\n" localhost:8121/keys -o /dev/null || true);
while [[ $HTTP_CODE != 200 && $MAX_TRIES > 0 ]] ; do
sleep 1;
HTTP_CODE=$(curl -sL -w "%{http_code}\\n" localhost:8121/keys -o /dev/null || true);
MAX_TRIES=$(( MAX_TRIES - 1 ));
done;
pip install .;
cd tests; python test_files/loadit_test.py
- stage: deploy
services: []
language: python
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ services:
PEEWEE_PORT: 5432
PEEWEE_PROTO: postgres
PEEWEE_PASS: metadata
METADATA_CPCONFIG: /usr/src/app/server.conf

0 comments on commit 1efb34a

Please sign in to comment.