Skip to content

Commit

Permalink
[WIP] Add docker run in travis tests (opsdroid#319)
Browse files Browse the repository at this point in the history
* Add docker build and run in test suites

* Fix container name in test suite

* Add docker logs to travis output

* Move docker test into tox config

* Add docker service to travis

* Add docker to tox's whitelist externals

* Fix tox docker test

* Add unit tests into docker container
  • Loading branch information
vitkhab authored and jacobtomlinson committed Nov 21, 2017
1 parent 88188bb commit c527336
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ sudo: false
matrix:
fast_finish: true
include:
- python: "3.5"
env: TOXENV=docker
- python: "3.5"
env: TOXENV=lint
- python: "3.5"
Expand All @@ -11,6 +13,8 @@ matrix:
cache:
directories:
- $HOME/.cache/pip
services:
- docker
install: pip install -U tox coveralls codecov
language: python
script: tox
Expand Down
18 changes: 17 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py35, py36, lint
envlist = py35, py36, lint, docker
skip_missing_interpreters = True

[testenv]
Expand All @@ -19,3 +19,19 @@ commands =
flake8
pylint opsdroid
pydocstyle opsdroid tests

[testenv:docker]
basepython = python3
ignore_errors = True
whitelist_externals =
docker
bash
commands =
docker build -t opsdroid-image:tmp .
docker run -d --name opsdroid-container opsdroid-image:tmp
docker exec -e TOXENV=py35 opsdroid-container tox
docker exec opsdroid-container sh -c "apk add --no-cache curl && curl -sSf http://localhost:8080/ || exit 1"
docker logs opsdroid-container
docker stop opsdroid-container
docker rm opsdroid-container
docker rmi opsdroid-image:tmp

0 comments on commit c527336

Please sign in to comment.