Merge lp:~vila/bzr/430749-no-extensions-warning into lp:bzr

Proposed by Vincent Ladeuil
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
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+11951@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

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.

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

Perhaps it would be clearer and simpler to add a method to TestCase:

self.disable_missing_extensions_warning()

?

Revision history for this message
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).

Revision history for this message
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://launchpad.net/~mbp/>

Revision history for this message
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://enigmail.mozdev.org/

iEYEARECAAYFAkq0P9QACgkQJdeBCYSNAAORMgCfT/dBFDj17+iDIW9wluK23U1T
ebsAninoVjFBVR0d22HoQ8B8o/KR7iEc
=4xsA
-----END PGP SIGNATURE-----

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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 to be parameterised. This is not expected to break external use of test
6 parameterisation, and is substantially faster. (Robert Collins)
7
8+* The full test suite is expected to pass when the C extensions are not
9+ present. (Vincent Ladeuil, #430749)
10
11 bzr 2.0rc2
12 ##########
13
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 import os
19 import sys
20
21-from bzrlib.tests.blackbox import TestCaseWithTransport
22-
23-class TestCat(TestCaseWithTransport):
24+from bzrlib import (
25+ config,
26+ tests,
27+ )
28+
29+
30+class TestCat(tests.TestCaseWithTransport):
31
32 def test_cat(self):
33 tree = self.make_branch_and_tree('branch')
34@@ -68,6 +72,7 @@
35
36 def test_cat_different_id(self):
37 """'cat' works with old and new files"""
38+ config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
39 tree = self.make_branch_and_tree('.')
40 # the files are named after their path in the revision and
41 # current trees later in the test case
42
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 import os
48 import re
49
50-import bzrlib
51-from bzrlib import workingtree
52-from bzrlib.branch import Branch
53-from bzrlib.tests import TestSkipped
54-from bzrlib.tests.blackbox import ExternalBase
55+from bzrlib import (
56+ config,
57+ tests,
58+ workingtree,
59+ )
60
61
62 def subst_dates(string):
63@@ -34,7 +34,7 @@
64 'YYYY-MM-DD HH:MM:SS +ZZZZ', string)
65
66
67-class DiffBase(ExternalBase):
68+class DiffBase(tests.TestCaseWithTransport):
69 """Base class with common setup method"""
70
71 def make_example_branch(self):
72@@ -355,6 +355,7 @@
73
74 def test_external_diff(self):
75 """Test that we can spawn an external diff process"""
76+ config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
77 # We have to use run_bzr_subprocess, because we need to
78 # test writing directly to stdout, (there was a bug in
79 # subprocess.py that we had to workaround).
80@@ -366,7 +367,7 @@
81 universal_newlines=True,
82 retcode=None)
83 if 'Diff is not installed on this machine' in err:
84- raise TestSkipped("No external 'diff' is available")
85+ raise tests.TestSkipped("No external 'diff' is available")
86 self.assertEqual('', err)
87 # We have to skip the stuff in the middle, because it depends
88 # on time.time()
89
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 import os
95 import sys
96
97-from bzrlib.tests import TestCaseWithTransport, TestSkipped
98-
99-
100-class TestLocale(TestCaseWithTransport):
101+from bzrlib import (
102+ config,
103+ tests,
104+ )
105+
106+
107+class TestLocale(tests.TestCaseWithTransport):
108
109 def setUp(self):
110 super(TestLocale, self).setUp()
111
112 if sys.platform in ('win32',):
113- raise TestSkipped('Windows does not respond to the LANG'
114- ' env variable')
115+ raise tests.TestSkipped('Windows does not respond to the LANG'
116+ ' env variable')
117
118 tree = self.make_branch_and_tree('tree')
119 self.build_tree(['tree/a'])
120@@ -41,6 +44,7 @@
121 self.tree = tree
122
123 def test_log_C(self):
124+ config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
125 out, err = self.run_bzr_subprocess(
126 '--no-aliases --no-plugins log -q --log-format=long tree',
127 env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none',
128
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 import threading
134
135 from bzrlib import (
136+ config,
137 errors,
138 osutils,
139 revision as _mod_revision,
140@@ -42,6 +43,10 @@
141
142 class TestBzrServe(TestCaseWithTransport):
143
144+ def setUp(self):
145+ super(TestBzrServe, self).setUp()
146+ config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
147+
148 def assertInetServerShutsdownCleanly(self, process):
149 """Shutdown the server process looking for errors."""
150 # Shutdown the server: the server should shut down when it cannot read
151
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 from bzrlib import (
157 branchbuilder,
158 bzrdir,
159+ config,
160 debug,
161 errors,
162 lockdir,
163@@ -2369,6 +2370,7 @@
164 """finish_bzr_subprocess raises self.failureException if the retcode is
165 not the expected one.
166 """
167+ config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
168 process = self.start_bzr_subprocess(['wait-until-signalled'],
169 skip_if_plan_to_signal=True)
170 self.assertEqual('running\n', process.stdout.readline())