Merge lp:~lifeless/pyjuju/testrsupport into lp:pyjuju

Proposed by Robert Collins
Status: Merged
Approved by: Gustavo Niemeyer
Approved revision: 545
Merged at revision: 546
Proposed branch: lp:~lifeless/pyjuju/testrsupport
Merge into: lp:pyjuju
Diff against target: 26 lines (+6/-1)
2 files modified
.bzrignore (+2/-1)
.testr.conf (+4/-0)
To merge this branch: bzr merge lp:~lifeless/pyjuju/testrsupport
Reviewer Review Type Date Requested Status
Gustavo Niemeyer Approve
Review via email: mp+111755@code.launchpad.net

Description of the change

Testrepository support [a=lifeless]

This adds a configuration for testrepository support to the source tree. Testrepository is super useful for iterating on test suites - particularly slow ones like juju's.

I also tweak the trial ignore rule, as trial will create multiple directories, not just _trial_temp.

While a testrepository tutorial is out of place here, I've included a sample transcript to give you a taste for using it:

juju/working$ testr init
juju/working$ testr run
running=./test --reporter=subunit
No handlers could be found for logger "juju.ec2"
Using system zookeeper classpath from /etc/zookeeper/conf/environment
Ran 1979 tests in 337.598s
PASSED (id=0, skips=12)
$ testr slowest
Test id Runtime (s)
------------------------------------------------------------------------------------------- -----------
juju.control.tests.test_status.StatusTest.test_subordinate_status_output 4.933
juju.control.tests.test_status.StatusTest.test_subordinate_status_output_no_container 4.751
juju.control.tests.test_status.StatusTest.test_collect_filtering 4.264
juju.lib.tests.test_zk.LocalManagedZookeeperTestCase.test_managed_zookeeper 3.900
juju.unit.tests.test_lifecycle.UnitLifecycleTest.test_lifecycle_start_stop_starts_relations 3.729
juju.control.tests.test_status.StatusTest.test_provider_pending_machine_state 3.220
juju.unit.tests.test_workflow.UnitWorkflowTest.test_synchronize_automatic 2.976
juju.control.tests.test_status.StatusTest.test_collect_with_unassigned_machines 2.969
juju.control.tests.test_status.StatusTest.test_collect_with_removed_unit 2.937
juju.control.tests.test_status.StatusTest.test_render_svg 2.909
$ testr failing
PASSED (id=0)
$ testr last
Ran 1979 tests in 337.598s
PASSED (id=0, skips=12)

R=niemeyer, hazmat
A=lifeless

To post a comment you must log in.
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

I don't know those tools, but it looks reasonable.

review: Approve
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

*** Submitted:

Testrepository support [a=lifeless]

This adds a configuration for testrepository support to the source tree. Testrepository is super useful for iterating on test suites - particularly slow ones like juju's.

I also tweak the trial ignore rule, as trial will create multiple directories, not just _trial_temp.

While a testrepository tutorial is out of place here, I've included a sample transcript to give you a taste for using it:

juju/working$ testr init
juju/working$ testr run
running=./test --reporter=subunit
No handlers could be found for logger "juju.ec2"
Using system zookeeper classpath from /etc/zookeeper/conf/environment
Ran 1979 tests in 337.598s
PASSED (id=0, skips=12)
$ testr slowest
Test id Runtime (s)
------------------------------------------------------------------------------------------- -----------
juju.control.tests.test_status.StatusTest.test_subordinate_status_output 4.933
juju.control.tests.test_status.StatusTest.test_subordinate_status_output_no_container 4.751
juju.control.tests.test_status.StatusTest.test_collect_filtering 4.264
juju.lib.tests.test_zk.LocalManagedZookeeperTestCase.test_managed_zookeeper 3.900
juju.unit.tests.test_lifecycle.UnitLifecycleTest.test_lifecycle_start_stop_starts_relations 3.729
juju.control.tests.test_status.StatusTest.test_provider_pending_machine_state 3.220
juju.unit.tests.test_workflow.UnitWorkflowTest.test_synchronize_automatic 2.976
juju.control.tests.test_status.StatusTest.test_collect_with_unassigned_machines 2.969
juju.control.tests.test_status.StatusTest.test_collect_with_removed_unit 2.937
juju.control.tests.test_status.StatusTest.test_render_svg 2.909
$ testr failing
PASSED (id=0)
$ testr last
Ran 1979 tests in 337.598s
PASSED (id=0, skips=12)

R=niemeyer, hazmat
A=lifeless

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

One issue to note on this is that it requires installing testrepository from bzr. The python egg on pypi appears to be not functional, the packaged version in precise doesn't have the slowest command.

Revision history for this message
Robert Collins (lifeless) wrote :

On Mon, Jul 2, 2012 at 6:08 AM, Kapil Thangavelu
<email address hidden> wrote:
> One issue to note on this is that it requires installing testrepository from bzr. The python egg on pypi appears to be not functional, the packaged version in precise doesn't have the slowest command.

The egg should work - can you file a bug with whatever is wrong? there
is also ppa:testing-cabal/archive

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-03-29 08:25:56 +0000
3+++ .bzrignore 2012-06-24 23:42:20 +0000
4@@ -1,6 +1,7 @@
5 /docs/build
6 /docs/source/generated
7 /_trial_temp
8+/_trial_temp-*
9 /tags
10 zookeeper.log
11 .emacs.desktop
12@@ -8,4 +9,4 @@
13 .coverage
14 htmlcov
15 /TAGS
16-
17+/.testrepository
18
19=== added file '.testr.conf'
20--- .testr.conf 1970-01-01 00:00:00 +0000
21+++ .testr.conf 2012-06-24 23:42:20 +0000
22@@ -0,0 +1,4 @@
23+[DEFAULT]
24+test_command=./test --reporter=subunit $LISTOPT $IDLIST
25+test_list_option=-n
26+

Subscribers

People subscribed via source and target branches

to status/vote changes: