Further optimise the Travis testing and improve running tests for a user

+ Convert setup.py test to run py.test instead of tox
  + Tox should now run setup.py test
  + TravisCI will create a job for each TOX_ENV and then execute
    tox to run the tests for that TOX_ENV
This commit is contained in:
Daniel Lintott 2014-08-09 12:05:31 +01:00
parent a4bc96af28
commit 4a33b2021c
3 changed files with 17 additions and 12 deletions

View File

@ -1,15 +1,19 @@
language: python
env:
- TOX_ENV=py33
- TOX_ENV=py34
before_install:
- "sudo add-apt-repository ppa:gns3/ppa -y"
- "sudo apt-get update -q"
- sudo add-apt-repository ppa:gns3/ppa -y
- sudo apt-get update -q
install:
- "pip install -r requirements.txt --use-mirrors"
- "pip install tox"
- "sudo apt-get install vpcs dynamips"
- pip install tox
- sudo apt-get install vpcs dynamips
script: "python setup.py test"
script:
- tox -e $TOX_ENV
branches:
only:

View File

@ -20,7 +20,7 @@ from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class Tox(TestCommand):
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
@ -29,8 +29,9 @@ class Tox(TestCommand):
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import tox
errcode = tox.cmdline(self.test_args)
import pytest
#errcode = tox.cmdline(self.test_args)
errcode = pytest.main(self.test_args)
sys.exit(errcode)
setup(
@ -38,8 +39,8 @@ setup(
version=__import__("gns3server").__version__,
url="http://github.com/GNS3/gns3-server",
license="GNU General Public License v3 (GPLv3)",
tests_require=["tox"],
cmdclass={"test": Tox},
tests_require=["pytest"],
cmdclass={"test": PyTest},
author="Jeremy Grossmann",
author_email="package-maintainer@gns3.net",
description="GNS3 server to asynchronously manage emulators",

View File

@ -2,6 +2,6 @@
envlist = py33, py34
[testenv]
commands = py.test [] -s tests
commands = python setup.py test
deps = -rdev-requirements.txt