mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Merge pull request #1192 from GNS3/travis-docker-tests
Tests on TravisCI with docker compose
This commit is contained in:
commit
e52b83be11
28
.travis.yml
28
.travis.yml
@ -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
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():
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user