Merge lp:~vila/bzr/selftest-start-load into lp:~bzr/bzr/trunk-old

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vila/bzr/selftest-start-load
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 84 lines
To merge this branch: bzr merge lp:~vila/bzr/selftest-start-load
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+8087@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

1) try: bzr selftest -s xxx --load failures
2) Cry
3) Apply proposed fix
4) ...
5) Rejoice !

Revision history for this message
Vincent Ladeuil (vila) wrote :

Given that https://code.edge.launchpad.net/~bzr/bzr/trunk says:

Last mirrored: 23 minutes ago
Next mirror: in 5 hours

I guess I'll have to resubmit to present a proper diff :-/

Revision history for this message
Martin Pool (mbp) wrote :

Please, when the diff is so big, put on a more explicit cover letter saying what you changed...

I guess you mean --load-list?

Revision history for this message
Martin Pool (mbp) wrote :

> Please, when the diff is so big, put on a more explicit cover letter saying
> what you changed...
>
> I guess you mean --load-list?

OK, I see the real diff is a bit more reasonable.

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

>>>>> "martin" == Martin Pool writes:

    martin> Review: Approve

Thanks.

    >> Please, when the diff is so big, put on a more explicit
    >> cover letter saying what you changed...

Talk about the lp bug ruining my joke...

The change had landed on bazaar-vcs.org when I did the merge
request, but apparently it hasn't been mirrored which may partly
explain the problem.

    >>
    >> I guess you mean --load-list?

    martin> OK, I see the real diff is a bit more reasonable.

Yes, the "real" diff was intended to be "obvious" :-/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/__init__.py'
2--- bzrlib/tests/__init__.py 2009-06-29 15:25:08 +0000
3+++ bzrlib/tests/__init__.py 2009-07-01 22:35:21 +0000
4@@ -3508,6 +3508,8 @@
5
6 loader = TestUtil.TestLoader()
7
8+ if keep_only is not None:
9+ id_filter = TestIdList(keep_only)
10 if starting_with:
11 starting_with = [test_prefix_alias_registry.resolve_alias(start)
12 for start in starting_with]
13@@ -3526,7 +3528,6 @@
14 loader = TestUtil.FilteredByModuleTestLoader(interesting_module)
15
16 elif keep_only is not None:
17- id_filter = TestIdList(keep_only)
18 loader = TestUtil.FilteredByModuleTestLoader(id_filter.refers_to)
19 def interesting_module(name):
20 return id_filter.refers_to(name)
21
22=== modified file 'bzrlib/tests/test_selftest.py'
23--- bzrlib/tests/test_selftest.py 2009-07-01 14:21:56 +0000
24+++ bzrlib/tests/test_selftest.py 2009-07-01 22:35:21 +0000
25@@ -2170,24 +2170,6 @@
26 self.assertTrue(id_list.refers_to('mod.class'))
27 self.assertTrue(id_list.refers_to('mod.class.meth'))
28
29- def test_test_suite(self):
30- # This test is slow, so we do a single test with one test in each
31- # category
32- test_list = [
33- # testmod_names
34- 'bzrlib.tests.blackbox.test_branch.TestBranch.test_branch',
35- 'bzrlib.tests.test_selftest.TestTestIdList.test_test_suite',
36- # transport implementations
37- 'bzrlib.tests.test_transport_implementations.TransportTests'
38- '.test_abspath(LocalURLServer)',
39- # modules_to_doctest
40- 'bzrlib.timestamp.format_highres_date',
41- # plugins can't be tested that way since selftest may be run with
42- # --no-plugins
43- ]
44- suite = tests.test_suite(test_list)
45- self.assertEquals(test_list, _test_ids(suite))
46-
47 def test_test_suite_matches_id_list_with_unknown(self):
48 loader = TestUtil.TestLoader()
49 suite = loader.loadTestsFromModuleName('bzrlib.tests.test_sampler')
50@@ -2213,6 +2195,34 @@
51 duplicates)
52
53
54+class TestTestSuite(tests.TestCase):
55+
56+ def test_test_suite(self):
57+ # This test is slow, so we do a single test with one test in each
58+ # category
59+ test_list = [
60+ # testmod_names
61+ 'bzrlib.tests.blackbox.test_branch.TestBranch.test_branch',
62+ 'bzrlib.tests.test_selftest.TestTestSuite.test_test_suite',
63+ # transport implementations
64+ 'bzrlib.tests.test_transport_implementations.TransportTests'
65+ '.test_abspath(LocalURLServer)',
66+ # modules_to_doctest
67+ 'bzrlib.timestamp.format_highres_date',
68+ # plugins can't be tested that way since selftest may be run with
69+ # --no-plugins
70+ ]
71+ suite = tests.test_suite(test_list)
72+ self.assertEquals(test_list, _test_ids(suite))
73+
74+ def test_test_suite_list_and_start(self):
75+ test_list = ['bzrlib.tests.test_selftest.TestTestSuite.test_test_suite']
76+ suite = tests.test_suite(test_list,
77+ ['bzrlib.tests.test_selftest.TestTestSuite'])
78+ # test_test_suite_list_and_start is not included
79+ self.assertEquals(test_list, _test_ids(suite))
80+
81+
82 class TestLoadTestIdList(tests.TestCaseInTempDir):
83
84 def _create_test_list_file(self, file_name, content):