Merge lp:~vila/bzr/430749-no-extensions-warning into lp:bzr
- 430749-no-extensions-warning
- Merge into bzr.dev
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~vila/bzr/430749-no-extensions-warning |
Merge into: | lp:bzr |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~vila/bzr/430749-no-extensions-warning |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
bzr-core | Pending | ||
Review via email: mp+11951@code.launchpad.net |
Commit message
Description of the change
Vincent Ladeuil (vila) wrote : | # |
Robert Collins (lifeless) wrote : | # |
Perhaps it would be clearer and simpler to add a method to TestCase:
self.disable_
?
Matthew Fuller (fullermd) wrote : | # |
> I chose to modify the tests that were expecting a clean stderr (or
> some expected stderr) because they were only a few of them.
This makes me a little nervous, in that it adds a new undocumented
rule about what you need to do if you care about stderr when writing a
test (and since pretty much anybody writing a test probably HAS
extensions, they'll never notice it either).
Martin Pool (mbp) wrote : | # |
2009/9/18 fullermd <email address hidden>:
>> I chose to modify the tests that were expecting a clean stderr (or
>> some expected stderr) because they were only a few of them.
>
> This makes me a little nervous, in that it adds a new undocumented
> rule about what you need to do if you care about stderr when writing a
> test (and since pretty much anybody writing a test probably HAS
> extensions, they'll never notice it either).
It does seem a bit hacky.
--
Martin <http://
John A Meinel (jameinel) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> 2009/9/18 fullermd <email address hidden>:
>>> I chose to modify the tests that were expecting a clean stderr (or
>>> some expected stderr) because they were only a few of them.
>> This makes me a little nervous, in that it adds a new undocumented
>> rule about what you need to do if you care about stderr when writing a
>> test (and since pretty much anybody writing a test probably HAS
>> extensions, they'll never notice it either).
>
> It does seem a bit hacky.
>
Though arguably this is why I asked Vincent to run the test suite on a
buildbot with extensions disabled... :)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkq
ebsAninoVjFBVR0
=4xsA
-----END PGP SIGNATURE-----
Preview Diff
1 | === modified file 'NEWS' | |||
2 | --- NEWS 2009-09-16 10:29:18 +0000 | |||
3 | +++ NEWS 2009-09-17 07:09:01 +0000 | |||
4 | @@ -125,6 +125,8 @@ | |||
5 | 125 | to be parameterised. This is not expected to break external use of test | 125 | to be parameterised. This is not expected to break external use of test |
6 | 126 | parameterisation, and is substantially faster. (Robert Collins) | 126 | parameterisation, and is substantially faster. (Robert Collins) |
7 | 127 | 127 | ||
8 | 128 | * The full test suite is expected to pass when the C extensions are not | ||
9 | 129 | present. (Vincent Ladeuil, #430749) | ||
10 | 128 | 130 | ||
11 | 129 | bzr 2.0rc2 | 131 | bzr 2.0rc2 |
12 | 130 | ########## | 132 | ########## |
13 | 131 | 133 | ||
14 | === modified file 'bzrlib/tests/blackbox/test_cat.py' | |||
15 | --- bzrlib/tests/blackbox/test_cat.py 2009-03-23 14:59:43 +0000 | |||
16 | +++ bzrlib/tests/blackbox/test_cat.py 2009-09-17 07:09:01 +0000 | |||
17 | @@ -22,9 +22,13 @@ | |||
18 | 22 | import os | 22 | import os |
19 | 23 | import sys | 23 | import sys |
20 | 24 | 24 | ||
24 | 25 | from bzrlib.tests.blackbox import TestCaseWithTransport | 25 | from bzrlib import ( |
25 | 26 | 26 | config, | |
26 | 27 | class TestCat(TestCaseWithTransport): | 27 | tests, |
27 | 28 | ) | ||
28 | 29 | |||
29 | 30 | |||
30 | 31 | class TestCat(tests.TestCaseWithTransport): | ||
31 | 28 | 32 | ||
32 | 29 | def test_cat(self): | 33 | def test_cat(self): |
33 | 30 | tree = self.make_branch_and_tree('branch') | 34 | tree = self.make_branch_and_tree('branch') |
34 | @@ -68,6 +72,7 @@ | |||
35 | 68 | 72 | ||
36 | 69 | def test_cat_different_id(self): | 73 | def test_cat_different_id(self): |
37 | 70 | """'cat' works with old and new files""" | 74 | """'cat' works with old and new files""" |
38 | 75 | config.GlobalConfig().set_user_option('ignore_missing_extensions', True) | ||
39 | 71 | tree = self.make_branch_and_tree('.') | 76 | tree = self.make_branch_and_tree('.') |
40 | 72 | # the files are named after their path in the revision and | 77 | # the files are named after their path in the revision and |
41 | 73 | # current trees later in the test case | 78 | # current trees later in the test case |
42 | 74 | 79 | ||
43 | === modified file 'bzrlib/tests/blackbox/test_diff.py' | |||
44 | --- bzrlib/tests/blackbox/test_diff.py 2009-06-17 05:11:41 +0000 | |||
45 | +++ bzrlib/tests/blackbox/test_diff.py 2009-09-17 07:09:01 +0000 | |||
46 | @@ -21,11 +21,11 @@ | |||
47 | 21 | import os | 21 | import os |
48 | 22 | import re | 22 | import re |
49 | 23 | 23 | ||
55 | 24 | import bzrlib | 24 | from bzrlib import ( |
56 | 25 | from bzrlib import workingtree | 25 | config, |
57 | 26 | from bzrlib.branch import Branch | 26 | tests, |
58 | 27 | from bzrlib.tests import TestSkipped | 27 | workingtree, |
59 | 28 | from bzrlib.tests.blackbox import ExternalBase | 28 | ) |
60 | 29 | 29 | ||
61 | 30 | 30 | ||
62 | 31 | def subst_dates(string): | 31 | def subst_dates(string): |
63 | @@ -34,7 +34,7 @@ | |||
64 | 34 | 'YYYY-MM-DD HH:MM:SS +ZZZZ', string) | 34 | 'YYYY-MM-DD HH:MM:SS +ZZZZ', string) |
65 | 35 | 35 | ||
66 | 36 | 36 | ||
68 | 37 | class DiffBase(ExternalBase): | 37 | class DiffBase(tests.TestCaseWithTransport): |
69 | 38 | """Base class with common setup method""" | 38 | """Base class with common setup method""" |
70 | 39 | 39 | ||
71 | 40 | def make_example_branch(self): | 40 | def make_example_branch(self): |
72 | @@ -355,6 +355,7 @@ | |||
73 | 355 | 355 | ||
74 | 356 | def test_external_diff(self): | 356 | def test_external_diff(self): |
75 | 357 | """Test that we can spawn an external diff process""" | 357 | """Test that we can spawn an external diff process""" |
76 | 358 | config.GlobalConfig().set_user_option('ignore_missing_extensions', True) | ||
77 | 358 | # We have to use run_bzr_subprocess, because we need to | 359 | # We have to use run_bzr_subprocess, because we need to |
78 | 359 | # test writing directly to stdout, (there was a bug in | 360 | # test writing directly to stdout, (there was a bug in |
79 | 360 | # subprocess.py that we had to workaround). | 361 | # subprocess.py that we had to workaround). |
80 | @@ -366,7 +367,7 @@ | |||
81 | 366 | universal_newlines=True, | 367 | universal_newlines=True, |
82 | 367 | retcode=None) | 368 | retcode=None) |
83 | 368 | if 'Diff is not installed on this machine' in err: | 369 | if 'Diff is not installed on this machine' in err: |
85 | 369 | raise TestSkipped("No external 'diff' is available") | 370 | raise tests.TestSkipped("No external 'diff' is available") |
86 | 370 | self.assertEqual('', err) | 371 | self.assertEqual('', err) |
87 | 371 | # We have to skip the stuff in the middle, because it depends | 372 | # We have to skip the stuff in the middle, because it depends |
88 | 372 | # on time.time() | 373 | # on time.time() |
89 | 373 | 374 | ||
90 | === modified file 'bzrlib/tests/blackbox/test_locale.py' | |||
91 | --- bzrlib/tests/blackbox/test_locale.py 2009-08-17 22:16:49 +0000 | |||
92 | +++ bzrlib/tests/blackbox/test_locale.py 2009-09-17 07:09:01 +0000 | |||
93 | @@ -19,17 +19,20 @@ | |||
94 | 19 | import os | 19 | import os |
95 | 20 | import sys | 20 | import sys |
96 | 21 | 21 | ||
101 | 22 | from bzrlib.tests import TestCaseWithTransport, TestSkipped | 22 | from bzrlib import ( |
102 | 23 | 23 | config, | |
103 | 24 | 24 | tests, | |
104 | 25 | class TestLocale(TestCaseWithTransport): | 25 | ) |
105 | 26 | |||
106 | 27 | |||
107 | 28 | class TestLocale(tests.TestCaseWithTransport): | ||
108 | 26 | 29 | ||
109 | 27 | def setUp(self): | 30 | def setUp(self): |
110 | 28 | super(TestLocale, self).setUp() | 31 | super(TestLocale, self).setUp() |
111 | 29 | 32 | ||
112 | 30 | if sys.platform in ('win32',): | 33 | if sys.platform in ('win32',): |
115 | 31 | raise TestSkipped('Windows does not respond to the LANG' | 34 | raise tests.TestSkipped('Windows does not respond to the LANG' |
116 | 32 | ' env variable') | 35 | ' env variable') |
117 | 33 | 36 | ||
118 | 34 | tree = self.make_branch_and_tree('tree') | 37 | tree = self.make_branch_and_tree('tree') |
119 | 35 | self.build_tree(['tree/a']) | 38 | self.build_tree(['tree/a']) |
120 | @@ -41,6 +44,7 @@ | |||
121 | 41 | self.tree = tree | 44 | self.tree = tree |
122 | 42 | 45 | ||
123 | 43 | def test_log_C(self): | 46 | def test_log_C(self): |
124 | 47 | config.GlobalConfig().set_user_option('ignore_missing_extensions', True) | ||
125 | 44 | out, err = self.run_bzr_subprocess( | 48 | out, err = self.run_bzr_subprocess( |
126 | 45 | '--no-aliases --no-plugins log -q --log-format=long tree', | 49 | '--no-aliases --no-plugins log -q --log-format=long tree', |
127 | 46 | env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none', | 50 | env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none', |
128 | 47 | 51 | ||
129 | === modified file 'bzrlib/tests/blackbox/test_serve.py' | |||
130 | --- bzrlib/tests/blackbox/test_serve.py 2009-09-08 03:31:31 +0000 | |||
131 | +++ bzrlib/tests/blackbox/test_serve.py 2009-09-17 07:09:01 +0000 | |||
132 | @@ -25,6 +25,7 @@ | |||
133 | 25 | import threading | 25 | import threading |
134 | 26 | 26 | ||
135 | 27 | from bzrlib import ( | 27 | from bzrlib import ( |
136 | 28 | config, | ||
137 | 28 | errors, | 29 | errors, |
138 | 29 | osutils, | 30 | osutils, |
139 | 30 | revision as _mod_revision, | 31 | revision as _mod_revision, |
140 | @@ -42,6 +43,10 @@ | |||
141 | 42 | 43 | ||
142 | 43 | class TestBzrServe(TestCaseWithTransport): | 44 | class TestBzrServe(TestCaseWithTransport): |
143 | 44 | 45 | ||
144 | 46 | def setUp(self): | ||
145 | 47 | super(TestBzrServe, self).setUp() | ||
146 | 48 | config.GlobalConfig().set_user_option('ignore_missing_extensions', True) | ||
147 | 49 | |||
148 | 45 | def assertInetServerShutsdownCleanly(self, process): | 50 | def assertInetServerShutsdownCleanly(self, process): |
149 | 46 | """Shutdown the server process looking for errors.""" | 51 | """Shutdown the server process looking for errors.""" |
150 | 47 | # Shutdown the server: the server should shut down when it cannot read | 52 | # Shutdown the server: the server should shut down when it cannot read |
151 | 48 | 53 | ||
152 | === modified file 'bzrlib/tests/test_selftest.py' | |||
153 | --- bzrlib/tests/test_selftest.py 2009-09-09 15:27:48 +0000 | |||
154 | +++ bzrlib/tests/test_selftest.py 2009-09-17 07:09:01 +0000 | |||
155 | @@ -28,6 +28,7 @@ | |||
156 | 28 | from bzrlib import ( | 28 | from bzrlib import ( |
157 | 29 | branchbuilder, | 29 | branchbuilder, |
158 | 30 | bzrdir, | 30 | bzrdir, |
159 | 31 | config, | ||
160 | 31 | debug, | 32 | debug, |
161 | 32 | errors, | 33 | errors, |
162 | 33 | lockdir, | 34 | lockdir, |
163 | @@ -2369,6 +2370,7 @@ | |||
164 | 2369 | """finish_bzr_subprocess raises self.failureException if the retcode is | 2370 | """finish_bzr_subprocess raises self.failureException if the retcode is |
165 | 2370 | not the expected one. | 2371 | not the expected one. |
166 | 2371 | """ | 2372 | """ |
167 | 2373 | config.GlobalConfig().set_user_option('ignore_missing_extensions', True) | ||
168 | 2372 | process = self.start_bzr_subprocess(['wait-until-signalled'], | 2374 | process = self.start_bzr_subprocess(['wait-until-signalled'], |
169 | 2373 | skip_if_plan_to_signal=True) | 2375 | skip_if_plan_to_signal=True) |
170 | 2374 | self.assertEqual('running\n', process.stdout.readline()) | 2376 | self.assertEqual('running\n', process.stdout.readline()) |
This patch fixes the failures encountered when running the test suite without the C extensions built.
I chose to modify the tests that were expecting a clean stderr (or some expected stderr) because
they were only a few of them.
An alternative would have been to force the config variable in the test base class
but I thought it was too big a hammer.