diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..8e00dc4371 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,31 @@ +sudo: false +language: python +python: + - '2.7' +env: + - TOXENV=api-lint + - TOXENV=api + - TOXENV=ui-lint + - TOXENV=ui +install: + - pip install tox +script: + - tox +# after_success: +# - TOXENV=coveralls tox +addons: + apt: + packages: + - swig + - libxmlsec1-dev + - postgresql-9.5 + - libssl-dev +cache: + pip: true + directories: + - node_modules + - .tox +services: + - mongodb + # Enable when we stop using sqlite for API tests + # - postgresql 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/requirements/requirements.txt b/requirements/requirements.txt index a6bda0f61c..bdc9c6945d 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -28,8 +28,8 @@ django-taggit==0.17.6 git+https://github.com/matburt/dm.xmlsec.binding.git@master#egg=dm.xmlsec.binding dogpile.core==0.4.1 funcsigs==0.4 -gevent==1.1rc3 -gevent-websocket==0.9.3 +gevent==1.1 +gevent-websocket==0.9.5 git+https://github.com/chrismeyersfsu/django-jsonfield.git@tower_0.9.12#egg=django-jsonfield git+https://github.com/chrismeyersfsu/django-qsstats-magic.git@tower_0.7.2#egg=django-qsstats-magic git+https://github.com/umutbozkurt/django-rest-framework-mongoengine.git@5dfa1df79f81765d36c0de31dc1c2f390e42d428#egg=django-rest-framework-mongoengine diff --git a/tox.ini b/tox.ini index ac36195f62..14726b2bd0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,50 +1,74 @@ [tox] +skipsdist = true envlist = - py26-dj14, py27-dj14, py26-dj15, py27-dj15, py26-dj16, py27-dj16 + api-lint, + ui-lint, + api, + ui, + coveralls [testenv] -commands = python manage.py test main -deps = - ansible==1.3.4 - python-ldap +basepython = python2.7 setenv = - DJANGO_SETTINGS_MODULE = awx.settings.development + DJANGO_SETTINGS_MODULE = awx.settings.development_quiet # For OS X to be able to install pycrypto. - CFLAGS=-I/opt/local/include -downloadcache = {toxworkdir}/cache + # 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:py26-dj14] -basepython = python2.6 +[testenv:api-lint] deps = - Django==1.4.10 - {[testenv]deps} + -r{toxinidir}/requirements/requirements.txt + -r{toxinidir}/requirements/requirements_dev.txt + coverage + coveralls +commands = + make flake8 -[testenv:py27-dj14] -basepython = python2.7 +[testenv:ui-lint] deps = - Django==1.4.10 - {[testenv]deps} + nodeenv +commands = + make jshint -[testenv:py26-dj15] -basepython = python2.6 +[testenv:api] deps = - Django==1.5.5 - {[testenv]deps} + -r{toxinidir}/requirements/requirements.txt + -r{toxinidir}/requirements/requirements_dev.txt + ansible + coverage + coveralls +commands = + python setup.py develop + # coverage run --help + # coverage run -p --source awx/main/tests -m pytest {posargs} + py.test awx/main/tests {posargs:-k 'not old'} -[testenv:py27-dj15] -basepython = python2.7 +[testenv:ui] deps = - Django==1.5.5 - {[testenv]deps} + nodeenv +commands = + make UI_TEST_MODE=CI test-ui -[testenv:py26-dj16] -basepython = python2.6 -deps = - Django==1.6 - {[testenv]deps} +[testenv:coveralls] +commands= + coverage combine + coverage report -m + coveralls -[testenv:py27-dj16] -basepython = python2.7 -deps = - Django==1.6 - {[testenv]deps} +[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