Updates to setup/requirements, add Makefile target for running tests with coverage.

This commit is contained in:
Chris Church 2013-05-21 19:08:46 -04:00
parent aeac739735
commit 9478d8d532
6 changed files with 72 additions and 32 deletions

25
.coveragerc Normal file
View File

@ -0,0 +1,25 @@
[run]
source = ansibleworks
branch = True
omit = ansibleworks/main/migrations/*
[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about missing debug-only code:
def __repr__
if self\.debug
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
ignore_errors = True

8
.gitignore vendored
View File

@ -1,10 +1,16 @@
ansibleworks/settings/local_settings.py*
ansibleworks/acom.sqlite3
ansibleworks/*.sqlite3
ansibleworks/projects
ansibleworks/public/media
ansibleworks/public/static
env/*
build
dist
htmlcov
*.egg-info
*.py[c,o]
*.swp
.coverage
coverage.xml
pep8.txt

View File

@ -58,6 +58,14 @@ dbshell:
test:
python manage.py test main
test_coverage:
# Run tests with coverage enabled.
coverage run manage.py test main
coverage_html:
# Output test coverage as HTML (into htmlcov directory).
coverage html
dev_build:
python setup.py dev_build

View File

@ -28,7 +28,11 @@
- python-devel # only because pexpect comes from pip
- python-lxml # xml for ?format=xml instead of json (optional)
- name: install python modules from pip
# python-setuptools package is old (0.6.10, ~2009) vs. latest distribute (0.6.40)
- name: install latest distribute from pypi
pip: name=distribute state=latest
- name: install python modules via pip
pip: requirements=${working_dir}/requirements.txt
- name: configure the database authentication more or less open for setup

View File

@ -1,21 +1,7 @@
# Local Django settings for Ansible Commander project.
# Copyright (c) 2013 AnsibleWorks, Inc.
#
# This file is part of Ansible Commander.
#
# Ansible Commander is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# Ansible Commander is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible Commander. If not, see <http://www.gnu.org/licenses/>.
# All Rights Reserved.
# Local Django settings for AnsibleWorks project.
from development import *

View File

@ -1,15 +1,26 @@
Django==1.5.1
django-celery==3.0.11
django-devserver==0.5.0
django-extensions==1.1.1
django-jsonfield==0.9.2
ipython==0.13.1
pexpect==2.4
# psycopg2==2.4.6
python-dateutil==1.5
# PyYAML==3.10
South==0.7.6
requests
djangorestframework
markdown
# PIP requirements for AnsibleWorks development/build environment.
# Install using "pip -r requirements.txt"
Django>=1.5
django-celery
django-devserver
django-extensions
django-filter
django-jsonfield
djangorestframework
ipython
markdown
pexpect
python-dateutil
PyYAML
South
# You may also need to install the following extra packages using the OS
# package manager, or pip if you're running inside a virtualenv.
# - ansible (via yum, pip or source checkout)
# - distribute (Use the latest version via "pip install -U distribute"; the
# default python-setuptools package is old.)
# - psycopg2 (via "yum install python-psycopg2")
# - coverage (if you want to check test coverage, via "pip install coverage";
# the default python-coverage package is old.)
# - readline (for using the ipython interactive shell)