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
=== modified file 'NEWS'
--- NEWS 2009-09-16 10:29:18 +0000
+++ NEWS 2009-09-17 07:09:01 +0000
@@ -125,6 +125,8 @@
125 to be parameterised. This is not expected to break external use of test125 to be parameterised. This is not expected to break external use of test
126 parameterisation, and is substantially faster. (Robert Collins)126 parameterisation, and is substantially faster. (Robert Collins)
127127
128* The full test suite is expected to pass when the C extensions are not
129 present. (Vincent Ladeuil, #430749)
128130
129bzr 2.0rc2131bzr 2.0rc2
130##########132##########
131133
=== modified file 'bzrlib/tests/blackbox/test_cat.py'
--- bzrlib/tests/blackbox/test_cat.py 2009-03-23 14:59:43 +0000
+++ bzrlib/tests/blackbox/test_cat.py 2009-09-17 07:09:01 +0000
@@ -22,9 +22,13 @@
22import os22import os
23import sys23import sys
2424
25from bzrlib.tests.blackbox import TestCaseWithTransport25from bzrlib import (
2626 config,
27class TestCat(TestCaseWithTransport):27 tests,
28 )
29
30
31class TestCat(tests.TestCaseWithTransport):
2832
29 def test_cat(self):33 def test_cat(self):
30 tree = self.make_branch_and_tree('branch')34 tree = self.make_branch_and_tree('branch')
@@ -68,6 +72,7 @@
6872
69 def test_cat_different_id(self):73 def test_cat_different_id(self):
70 """'cat' works with old and new files"""74 """'cat' works with old and new files"""
75 config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
71 tree = self.make_branch_and_tree('.')76 tree = self.make_branch_and_tree('.')
72 # the files are named after their path in the revision and77 # the files are named after their path in the revision and
73 # current trees later in the test case78 # current trees later in the test case
7479
=== modified file 'bzrlib/tests/blackbox/test_diff.py'
--- bzrlib/tests/blackbox/test_diff.py 2009-06-17 05:11:41 +0000
+++ bzrlib/tests/blackbox/test_diff.py 2009-09-17 07:09:01 +0000
@@ -21,11 +21,11 @@
21import os21import os
22import re22import re
2323
24import bzrlib24from bzrlib import (
25from bzrlib import workingtree25 config,
26from bzrlib.branch import Branch26 tests,
27from bzrlib.tests import TestSkipped27 workingtree,
28from bzrlib.tests.blackbox import ExternalBase28 )
2929
3030
31def subst_dates(string):31def subst_dates(string):
@@ -34,7 +34,7 @@
34 'YYYY-MM-DD HH:MM:SS +ZZZZ', string)34 'YYYY-MM-DD HH:MM:SS +ZZZZ', string)
3535
3636
37class DiffBase(ExternalBase):37class DiffBase(tests.TestCaseWithTransport):
38 """Base class with common setup method"""38 """Base class with common setup method"""
3939
40 def make_example_branch(self):40 def make_example_branch(self):
@@ -355,6 +355,7 @@
355355
356 def test_external_diff(self):356 def test_external_diff(self):
357 """Test that we can spawn an external diff process"""357 """Test that we can spawn an external diff process"""
358 config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
358 # We have to use run_bzr_subprocess, because we need to359 # We have to use run_bzr_subprocess, because we need to
359 # test writing directly to stdout, (there was a bug in360 # test writing directly to stdout, (there was a bug in
360 # subprocess.py that we had to workaround).361 # subprocess.py that we had to workaround).
@@ -366,7 +367,7 @@
366 universal_newlines=True,367 universal_newlines=True,
367 retcode=None)368 retcode=None)
368 if 'Diff is not installed on this machine' in err:369 if 'Diff is not installed on this machine' in err:
369 raise TestSkipped("No external 'diff' is available")370 raise tests.TestSkipped("No external 'diff' is available")
370 self.assertEqual('', err)371 self.assertEqual('', err)
371 # We have to skip the stuff in the middle, because it depends372 # We have to skip the stuff in the middle, because it depends
372 # on time.time()373 # on time.time()
373374
=== modified file 'bzrlib/tests/blackbox/test_locale.py'
--- bzrlib/tests/blackbox/test_locale.py 2009-08-17 22:16:49 +0000
+++ bzrlib/tests/blackbox/test_locale.py 2009-09-17 07:09:01 +0000
@@ -19,17 +19,20 @@
19import os19import os
20import sys20import sys
2121
22from bzrlib.tests import TestCaseWithTransport, TestSkipped22from bzrlib import (
2323 config,
2424 tests,
25class TestLocale(TestCaseWithTransport):25 )
26
27
28class TestLocale(tests.TestCaseWithTransport):
2629
27 def setUp(self):30 def setUp(self):
28 super(TestLocale, self).setUp()31 super(TestLocale, self).setUp()
2932
30 if sys.platform in ('win32',):33 if sys.platform in ('win32',):
31 raise TestSkipped('Windows does not respond to the LANG'34 raise tests.TestSkipped('Windows does not respond to the LANG'
32 ' env variable')35 ' env variable')
3336
34 tree = self.make_branch_and_tree('tree')37 tree = self.make_branch_and_tree('tree')
35 self.build_tree(['tree/a'])38 self.build_tree(['tree/a'])
@@ -41,6 +44,7 @@
41 self.tree = tree44 self.tree = tree
4245
43 def test_log_C(self):46 def test_log_C(self):
47 config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
44 out, err = self.run_bzr_subprocess(48 out, err = self.run_bzr_subprocess(
45 '--no-aliases --no-plugins log -q --log-format=long tree',49 '--no-aliases --no-plugins log -q --log-format=long tree',
46 env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none',50 env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none',
4751
=== modified file 'bzrlib/tests/blackbox/test_serve.py'
--- bzrlib/tests/blackbox/test_serve.py 2009-09-08 03:31:31 +0000
+++ bzrlib/tests/blackbox/test_serve.py 2009-09-17 07:09:01 +0000
@@ -25,6 +25,7 @@
25import threading25import threading
2626
27from bzrlib import (27from bzrlib import (
28 config,
28 errors,29 errors,
29 osutils,30 osutils,
30 revision as _mod_revision,31 revision as _mod_revision,
@@ -42,6 +43,10 @@
4243
43class TestBzrServe(TestCaseWithTransport):44class TestBzrServe(TestCaseWithTransport):
4445
46 def setUp(self):
47 super(TestBzrServe, self).setUp()
48 config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
49
45 def assertInetServerShutsdownCleanly(self, process):50 def assertInetServerShutsdownCleanly(self, process):
46 """Shutdown the server process looking for errors."""51 """Shutdown the server process looking for errors."""
47 # Shutdown the server: the server should shut down when it cannot read52 # Shutdown the server: the server should shut down when it cannot read
4853
=== modified file 'bzrlib/tests/test_selftest.py'
--- bzrlib/tests/test_selftest.py 2009-09-09 15:27:48 +0000
+++ bzrlib/tests/test_selftest.py 2009-09-17 07:09:01 +0000
@@ -28,6 +28,7 @@
28from bzrlib import (28from bzrlib import (
29 branchbuilder,29 branchbuilder,
30 bzrdir,30 bzrdir,
31 config,
31 debug,32 debug,
32 errors,33 errors,
33 lockdir,34 lockdir,
@@ -2369,6 +2370,7 @@
2369 """finish_bzr_subprocess raises self.failureException if the retcode is2370 """finish_bzr_subprocess raises self.failureException if the retcode is
2370 not the expected one.2371 not the expected one.
2371 """2372 """
2373 config.GlobalConfig().set_user_option('ignore_missing_extensions', True)
2372 process = self.start_bzr_subprocess(['wait-until-signalled'],2374 process = self.start_bzr_subprocess(['wait-until-signalled'],
2373 skip_if_plan_to_signal=True)2375 skip_if_plan_to_signal=True)
2374 self.assertEqual('running\n', process.stdout.readline())2376 self.assertEqual('running\n', process.stdout.readline())