Merge lp:~canonical-isd-hackers/canonical-identity-provider/hudson into lp:canonical-identity-provider/release

Proposed by Ricardo Kirkner
Status: Merged
Approved by: Ricardo Kirkner
Approved revision: no longer in the source branch.
Merged at revision: 133
Proposed branch: lp:~canonical-isd-hackers/canonical-identity-provider/hudson
Merge into: lp:canonical-identity-provider/release
Diff against target: 75 lines (+27/-5)
3 files modified
fabfile.py (+3/-0)
payload/__init__.py (+22/-4)
requirements.txt (+2/-1)
To merge this branch: bzr merge lp:~canonical-isd-hackers/canonical-identity-provider/hudson
Reviewer Review Type Date Requested Status
Anthony Lenton (community) Approve
Review via email: mp+52224@code.launchpad.net

Commit message

added better hudson support

Description of the change

This branch adds some changes to make hudson integration easier

To post a comment you must log in.
Revision history for this message
Anthony Lenton (elachuni) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'fabfile.py'
2--- fabfile.py 2011-03-04 18:16:47 +0000
3+++ fabfile.py 2011-03-04 20:07:39 +0000
4@@ -1,2 +1,5 @@
5+# Copyright 2010 Canonical Ltd. This software is licensed under the
6+# GNU Affero General Public License version 3 (see the file LICENSE).
7+
8 # use a payload package to keep fabric code organized
9 from payload import *
10
11=== modified file 'payload/__init__.py'
12--- payload/__init__.py 2011-03-04 18:16:47 +0000
13+++ payload/__init__.py 2011-03-04 20:07:39 +0000
14@@ -12,6 +12,9 @@
15 from .virtualenv import *
16 from .postgresql import *
17
18+# make sure the virtualenv is automatically activated
19+setup_virtualenv()
20+
21
22 # constants
23 # =========
24@@ -49,18 +52,33 @@
25
26 def clean_coverage():
27 """Remove coverage report files."""
28- local("rm -rf .coverage coverage.d coverage.xml")
29+ with cd('django_project'):
30+ local("rm -rf .coverage coverage.d coverage.xml")
31
32
33 # development
34-def test(functional=False):
35- """Run whole test suite."""
36- cmd = ['cd django_project &&', 'nosetests --with-django identityprovider']
37+def test(functional=False, coverage=False, hudson=False):
38+ """Run the test suite."""
39+ cmd = ['cd django_project &&',
40+ 'PYTHONPATH=. nosetests --with-django identityprovider']
41 if not functional:
42 cmd.append("--eval-attr='not functional'")
43+ if coverage or hudson:
44+ cmd.append('--with-coverage --cover-package=identityprovider')
45+ if hudson:
46+ # add support for cobertura
47+ cmd.append('--with-xcoverage')
48+ cmd.append('--with-xunit')
49 virtualenv(' '.join(cmd), capture=False)
50
51
52+def hudson():
53+ """Run the tests for hudson."""
54+ bootstrap()
55+ resetdb()
56+ test(functional=True, coverage=True, hudson=True)
57+
58+
59 def run():
60 """Run development server using whole WSGI stack."""
61 virtualenv('python wsgiserver.py', capture=False)
62
63=== modified file 'requirements.txt'
64--- requirements.txt 2011-03-03 13:57:50 +0000
65+++ requirements.txt 2011-03-04 20:07:39 +0000
66@@ -55,7 +55,8 @@
67 # testing dependencies
68 BeautifulSoup==3.1.0.1
69 NoseDjango==0.8.1
70-coverage==2.85
71+nosexcover
72+coverage<3.4
73 mock==0.6.0
74 wsgiref==0.1.2
75 lazr.restfulclient==0.9.11