mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Tests on TravisCI with docker compose
This commit is contained in:
parent
67c78ba2e3
commit
0c7a92b710
28
.travis.yml
28
.travis.yml
@ -1,17 +1,15 @@
|
|||||||
language: python
|
sudo: required
|
||||||
python:
|
|
||||||
- '3.4'
|
services:
|
||||||
- '3.5'
|
- docker
|
||||||
- '3.6'
|
|
||||||
sudo: false
|
|
||||||
cache: pip
|
|
||||||
install:
|
install:
|
||||||
- pip install -U setuptools pip
|
- sed -e 's/${PYTHON_VERSION}/'${PYTHON_VERSION}/g DockerfileTests.tpl > /tmp/DockerfileTests
|
||||||
- python setup.py install
|
- docker-compose build
|
||||||
- pip install -rdev-requirements.txt
|
|
||||||
script:
|
script:
|
||||||
- mkdir ‡
|
- docker-compose run tests
|
||||||
- py.test -v -s tests --basetemp=‡
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: pypi
|
provider: pypi
|
||||||
user: noplay
|
user: noplay
|
||||||
@ -20,3 +18,9 @@ deploy:
|
|||||||
on:
|
on:
|
||||||
tags: true
|
tags: true
|
||||||
repo: GNS3/gns3-server
|
repo: GNS3/gns3-server
|
||||||
|
|
||||||
|
env:
|
||||||
|
matrix:
|
||||||
|
- PYTHON_VERSION=3.4
|
||||||
|
- PYTHON_VERSION=3.5
|
||||||
|
- PYTHON_VERSION=3.6
|
||||||
|
15
DockerfileTests.tpl
Normal file
15
DockerfileTests.tpl
Normal 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
docker-compose.yml
Normal file
4
docker-compose.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
tests:
|
||||||
|
build: .
|
||||||
|
dockerfile: /tmp/DockerfileTests
|
||||||
|
command: py.test -v -s tests
|
@ -83,7 +83,7 @@ def http_server(request, loop, port_manager, monkeypatch, controller):
|
|||||||
for method, route, handler in Route.get_routes():
|
for method, route, handler in Route.get_routes():
|
||||||
app.router.add_route(method, route, handler)
|
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
|
# 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):
|
for i in range(0, 5):
|
||||||
|
Loading…
Reference in New Issue
Block a user