Tests on TravisCI with docker compose

This commit is contained in:
ziajka committed 2017-10-12 10:40:49 +02:00
1 parent 67c78ba2e3
commit 0c7a92b710
4 files changed
+36 -13

No files matched your search

+16 -12
View File
@@ -1,17 +1,15 @@
language: python
python:
- '3.4'
- '3.5'
- '3.6'
sudo: false
cache: pip
sudo: required
services:
- docker
install:
- pip install -U setuptools pip
- python setup.py install
- pip install -rdev-requirements.txt
- sed -e 's/${PYTHON_VERSION}/'${PYTHON_VERSION}/g DockerfileTests.tpl > /tmp/DockerfileTests
- docker-compose build
script:
- mkdir ‡
- py.test -v -s tests --basetemp=‡
- docker-compose run tests
deploy:
provider: pypi
user: noplay
@@ -20,3 +18,9 @@ deploy:
on:
tags: true
repo: GNS3/gns3-server
env:
matrix:
- PYTHON_VERSION=3.4
- PYTHON_VERSION=3.5
- PYTHON_VERSION=3.6
+15
View File
@@ -0,0 +1,15 @@
FROM python:${PYTHON_VERSION}
RUN pip install -U setuptools pip
ADD requirements.txt /server/requirements.txt
ADD dev-requirements.txt /server/dev-requirements.txt
RUN pip install -r/server/dev-requirements.txt
RUN useradd -ms /bin/bash gns3
USER gns3
ADD . /server
WORKDIR /server
+4
View File
@@ -0,0 +1,4 @@
tests:
build: .
dockerfile: /tmp/DockerfileTests
command: py.test -v -s tests
+1 -1
View File
@@ -83,7 +83,7 @@ def http_server(request, loop, port_manager, monkeypatch, controller):
for method, route, handler in Route.get_routes():
app.router.add_route(method, route, handler)
host = "localhost"
host = "127.0.0.1"
# We try multiple time. Because on Travis test can fail when because the port is taken by someone else
for i in range(0, 5):