From 6140c8c500018dfc82074c45d42bdc182185f1b6 Mon Sep 17 00:00:00 2001 From: James Laska Date: Wed, 8 Jun 2016 15:41:59 -0400 Subject: [PATCH] Additional travis/tox tweaks * Enable travis caching * Disable coverage after_build * Call setup.py develop first * Include pytest config and enable skipsdist --- .travis.yml | 10 +++++++--- pytest.ini | 2 +- tox.ini | 39 +++++++++++++++++++++++++++++++++------ 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61c97e8024..f27f600962 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,8 @@ install: - pip install tox script: - tox -after_success: - - TOXENV=coveralls tox +# after_success: +# - TOXENV=coveralls tox addons: apt: packages: @@ -20,4 +20,8 @@ addons: - libxmlsec1-dev - postgresql-9.5 - libssl-dev - +cache: + pip: true + directories: + - node_modules + - .tox diff --git a/pytest.ini b/pytest.ini index 048e98312f..03c814599c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,7 +3,7 @@ DJANGO_SETTINGS_MODULE = awx.settings.development python_paths = venv/tower/lib/python2.7/site-packages site_dirs = venv/tower/lib/python2.7/site-packages python_files = *.py -addopts = --reuse-db --nomigrations +addopts = --reuse-db --nomigrations --tb=native markers = ac: access control test license_feature: ensure license features are accessible or not depending on license diff --git a/tox.ini b/tox.ini index cdbf5ea71f..93c8b2f224 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,5 @@ [tox] +skipsdist = true envlist = api-lint, ui-lint, @@ -11,30 +12,46 @@ basepython = python2.7 setenv = DJANGO_SETTINGS_MODULE = awx.settings.development_quiet # For OS X to be able to install pycrypto. - CFLAGS = -I/opt/local/include + # CFLAGS = -I/opt/local/include + SWIG_FEATURES = -cpperraswarn -includeall -I/usr/include/openssl HOME = {homedir} USERPROFILE = {homedir} + ANSIBLE_USE_VENV = True + ANSIBLE_VENV_PATH = {toxworkdir} + TOWER_USE_VENV = True + TOWER_VENV_PATH = {toxworkdir} + SKIP_SLOW_TESTS = True + +[testenv:api-lint] deps = -r{toxinidir}/requirements/requirements.txt -r{toxinidir}/requirements/requirements_dev.txt coverage coveralls - nodeenv - -[testenv:api-lint] commands = make flake8 - coverage erase [testenv:ui-lint] +deps = + nodeenv commands = make jshint [testenv:api] +deps = + -r{toxinidir}/requirements/requirements.txt + -r{toxinidir}/requirements/requirements_dev.txt + coverage + coveralls commands = - coverage run --parallel -m pytest --create-db --source awx/main/tests {posargs} + python setup.py develop + # coverage run --help + # coverage run -p --source awx/main/tests -m pytest {posargs} + py.test awx/main/tests {posargs} [testenv:ui] +deps = + nodeenv commands = make UI_TEST_MODE=CI test-ui @@ -44,3 +61,13 @@ commands= coverage report -m coveralls +[pytest] +DJANGO_SETTINGS_MODULE = awx.settings.development +python_paths = venv/tower/lib/python2.7/site-packages +site_dirs = venv/tower/lib/python2.7/site-packages +python_files = *.py +addopts = --reuse-db --nomigrations --tb=native +markers = + ac: access control test + license_feature: ensure license features are accessible or not depending on license + mongo_db: drop mongodb test database before test runs