Merge lp:~jameinel/goose/test-run-juju-core into lp:~gophers/goose/trunk

Proposed by John A Meinel
Status: Merged
Merged at revision: 60
Proposed branch: lp:~jameinel/goose/test-run-juju-core
Merge into: lp:~gophers/goose/trunk
Diff against target: 54 lines (+18/-1)
1 file modified
test.py (+18/-1)
To merge this branch: bzr merge lp:~jameinel/goose/test-run-juju-core
Reviewer Review Type Date Requested Status
Ian Booth (community) Approve
Review via email: mp+145772@code.launchpad.net

Description of the change

test.py: add --juju-core flag

Add the ability to run the juju-core test suite as part of
landing changes to trunk.

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :

Looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test.py'
2--- test.py 2013-01-30 13:08:32 +0000
3+++ test.py 2013-01-31 05:39:20 +0000
4@@ -88,7 +88,7 @@
5 # latest juju-core and everything else. The other is where the
6 # goose-under-test resides. So we don't add the goose-under-test to GOPATH,
7 # call "go get", then add it to the GOPATH for the rest of the testing.
8- cmd = ['go', 'get', '-u', 'launchpad.net/juju-core/...']
9+ cmd = ['go', 'get', '-u', '-x', 'launchpad.net/juju-core/...']
10 sys.stderr.write('Running: %s\n' % (' '.join(cmd),))
11 retcode = subprocess.call(cmd)
12 if retcode != 0:
13@@ -139,10 +139,23 @@
14 def run_go_build(opts):
15 return run_cmd(['go', 'build', './...'])
16
17+
18 def run_go_test(opts):
19+ # Note: I wish we could run this with '-gocheck.v'
20 return run_cmd(['go', 'test', './...'])
21
22
23+def run_juju_core_tests(opts):
24+ """Run the """
25+ orig_wd = os.getcwd()
26+ try:
27+ sys.stderr.write('Switching to juju-core')
28+ os.chdir('../juju-core')
29+ return run_cmd(['go', 'test', './...'])
30+ finally:
31+ os.chdir(orig_wd)
32+
33+
34 def run_live_tests(opts):
35 """Run all of the live tests."""
36 orig_wd = os.getcwd()
37@@ -169,6 +182,8 @@
38 help="Pass this if the script is running as the tarmac bot."
39 " This is used for stuff like ensuring repositories and"
40 " logging directories are initialized.")
41+ p.add_argument('--juju-core', action='store_true',
42+ help="Run the juju-core trunk tests as well as the goose tests.")
43 p.add_argument('--live', action='store_true',
44 help="Run tests against a live service.")
45
46@@ -177,6 +192,8 @@
47 if opts.tarmac:
48 tarmac_setup(opts)
49 to_run = [run_go_fmt, run_go_build, run_go_test]
50+ if opts.juju_core:
51+ to_run.append(run_juju_core_tests)
52 if opts.live:
53 to_run.append(run_live_tests)
54 for func in to_run:

Subscribers

People subscribed via source and target branches