summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Laska <jlaska@ansible.com>2015-03-10 19:38:37 -0400
committerJames Laska <jlaska@ansible.com>2015-03-13 08:20:24 -0400
commit3d67e9e0c0df18e5c82e62fdb79820724dbe2577 (patch)
treee0943c71ace01e7e05fb64e54c9edfe2d49cf7c9
parentc8de03d516adeae9b899212569528be559c6209f (diff)
downloadansible-3d67e9e0c0df18e5c82e62fdb79820724dbe2577.tar.gz
Add tox and travis-ci support
Add tox integration to run unittests in supported python releases. Travis-CI is used for test execution. Additionally, the unittest TestQuotePgIdentifier was updated to support using assert_raises_regexp on python-2.6. Sample travis-ci output available at https://travis-ci.org/ansible/ansible/builds/54189977
-rw-r--r--.coveragerc4
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml11
-rw-r--r--Makefile2
-rw-r--r--README.md4
-rw-r--r--test-requirements.txt2
-rw-r--r--tox.ini7
7 files changed, 29 insertions, 2 deletions
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000000..812fc3b139
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,4 @@
+[report]
+omit =
+ */python?.?/*
+ */site-packages/nose/*
diff --git a/.gitignore b/.gitignore
index 5fe1d994e3..5d3970a168 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,6 +42,7 @@ deb-build
credentials.yml
# test output
.coverage
+.tox
results.xml
coverage.xml
/test/units/cover-html
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..6e18e06050
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+sudo: false
+language: python
+env:
+ - TOXENV=py26
+ - TOXENV=py27
+install:
+ - pip install tox
+script:
+ - tox
+after_success:
+ - coveralls
diff --git a/Makefile b/Makefile
index f688bd73bf..81e24efab3 100644
--- a/Makefile
+++ b/Makefile
@@ -93,7 +93,7 @@ NOSETESTS3 ?= nosetests-3.3
all: clean python
tests:
- PYTHONPATH=./lib $(NOSETESTS) -d -w test/units -v # Could do: --with-coverage --cover-package=ansible
+ PYTHONPATH=./lib $(NOSETESTS) -d -w test/units -v --with-coverage --cover-package=ansible --cover-branches
newtests:
PYTHONPATH=./v2:./lib $(NOSETESTS) -d -w v2/test -v --with-coverage --cover-package=ansible --cover-branches
diff --git a/README.md b/README.md
index 8bfe58a543..e052e78dcd 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
-[![PyPI version](https://badge.fury.io/py/ansible.png)](http://badge.fury.io/py/ansible) [![PyPI downloads](https://pypip.in/d/ansible/badge.png)](https://pypi.python.org/pypi/ansible)
+[![PyPI version](https://badge.fury.io/py/ansible.png)](http://badge.fury.io/py/ansible)
+[![PyPI downloads](https://pypip.in/d/ansible/badge.png)](https://pypi.python.org/pypi/ansible)
+[![Build Status](https://travis-ci.org/ansible/ansible.svg?branch=tox_and_travis)](https://travis-ci.org/ansible/ansible)
Ansible
diff --git a/test-requirements.txt b/test-requirements.txt
index 714b65b764..abb61ed1e9 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -5,3 +5,5 @@
nose
mock
passlib
+coverage
+coveralls
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000000..7c86e7e08f
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,7 @@
+[tox]
+envlist = py26,py27
+
+[testenv]
+deps = -r{toxinidir}/test-requirements.txt
+whitelist_externals = make
+commands = make tests