Merge lp:~mwhudson/launchpad/bzr-2.1b3-support into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Paul Hummer
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/bzr-2.1b3-support
Merge into: lp:launchpad
Diff against target: 251 lines (+40/-17)
12 files modified
lib/devscripts/tests/test_sourcecode.py (+4/-0)
lib/lp/code/model/tests/test_branchjob.py (+1/-1)
lib/lp/codehosting/codeimport/tests/test_worker.py (+4/-0)
lib/lp/codehosting/codeimport/tests/test_workermonitor.py (+11/-10)
lib/lp/codehosting/puller/tests/__init__.py (+1/-0)
lib/lp/codehosting/puller/tests/test_scheduler.py (+9/-0)
lib/lp/codehosting/puller/tests/test_worker.py (+1/-0)
lib/lp/codehosting/tests/test_acceptance.py (+1/-0)
lib/lp/codehosting/tests/test_bzrutils.py (+5/-1)
lib/lp/codehosting/vfs/tests/test_branchfs.py (+1/-0)
lib/lp/codehosting/vfs/tests/test_filesystem.py (+1/-0)
versions.cfg (+1/-5)
To merge this branch: bzr merge lp:~mwhudson/launchpad/bzr-2.1b3-support
Reviewer Review Type Date Requested Status
Paul Hummer (community) Approve
Review via email: mp+15114@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hello.

This branch moves us to bzr 2.1b3. There are a few changes:

 * bzrlib now attempts to enforce that tests don't read out of their isolated area on the file system, which breaks many many launchpad tests.
   * I just scattered calls to disable_directory_isolation() around where it was needed, which perhaps isn't very awesome but it works.
 * $BZR_HOME and $HOME tend to be unicode now in TestCaseWithMemoryTransport tests (bzr bug 464174).
   * One test didn't need to subclass this class.
   * TestPullerMasterIntegration hacks around this.
 * WorkingTree.merge_from_branch now needs a force argument to create a revision with >2 parents, just like the CLI.

Cheers,
mwh

Revision history for this message
Paul Hummer (rockstar) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/devscripts/tests/test_sourcecode.py'
2--- lib/devscripts/tests/test_sourcecode.py 2009-09-30 11:56:28 +0000
3+++ lib/devscripts/tests/test_sourcecode.py 2009-11-21 02:05:26 +0000
4@@ -147,6 +147,10 @@
5 class TestFindBranches(TestCase):
6 """Tests the way that we find branches."""
7
8+ def setUp(self):
9+ TestCase.setUp(self)
10+ self.disable_directory_isolation()
11+
12 def makeBranch(self, path):
13 transport = get_transport(path)
14 transport.ensure_base()
15
16=== modified file 'lib/lp/code/model/tests/test_branchjob.py'
17--- lib/lp/code/model/tests/test_branchjob.py 2009-10-26 21:03:00 +0000
18+++ lib/lp/code/model/tests/test_branchjob.py 2009-11-21 02:05:26 +0000
19@@ -526,7 +526,7 @@
20 tree.merge_from_branch(tree2.branch)
21 tree3 = tree.bzrdir.sprout('tree3').open_workingtree()
22 tree3.commit('rev2b', rev_id='rev2b-id', committer='qux@')
23- tree.merge_from_branch(tree3.branch)
24+ tree.merge_from_branch(tree3.branch, force=True)
25 if include_ghost:
26 tree.add_parent_tree_id('rev2c-id')
27 tree.commit('rev2d', rev_id='rev2d-id', timestamp=1000, timezone=0,
28
29=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
30--- lib/lp/codehosting/codeimport/tests/test_worker.py 2009-09-18 01:36:48 +0000
31+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2009-11-21 02:05:26 +0000
32@@ -49,6 +49,10 @@
33
34 layer = BaseLayer
35
36+ def setUp(self):
37+ TestCaseWithTransport.setUp(self)
38+ self.disable_directory_isolation()
39+
40 def assertDirectoryTreesEqual(self, directory1, directory2):
41 """Assert that `directory1` has the same structure as `directory2`.
42
43
44=== modified file 'lib/lp/codehosting/codeimport/tests/test_workermonitor.py'
45--- lib/lp/codehosting/codeimport/tests/test_workermonitor.py 2009-09-16 00:28:31 +0000
46+++ lib/lp/codehosting/codeimport/tests/test_workermonitor.py 2009-11-21 02:05:26 +0000
47@@ -11,15 +11,14 @@
48 import os
49 import shutil
50 import StringIO
51-import sys
52 import tempfile
53 import unittest
54
55 from bzrlib.branch import Branch
56-from bzrlib.tests import TestCaseWithMemoryTransport
57+from bzrlib.tests import TestCase as BzrTestCase
58
59 from twisted.internet import defer, error, protocol, reactor
60-from twisted.trial.unittest import TestCase
61+from twisted.trial.unittest import TestCase as TrialTestCase
62
63 from zope.component import getUtility
64 from zope.security.proxy import removeSecurityProxy
65@@ -49,7 +48,7 @@
66 from lp.testing.factory import LaunchpadObjectFactory
67
68
69-class TestWorkerMonitorProtocol(ProcessTestsMixin, TestCase):
70+class TestWorkerMonitorProtocol(ProcessTestsMixin, TrialTestCase):
71
72 layer = TwistedLayer
73
74@@ -127,13 +126,14 @@
75 self.protocol._tail, 'line 3\nline 4\nline 5\nline 6\n')
76
77
78-class TestWorkerMonitorUnit(TestCase):
79+class TestWorkerMonitorUnit(TrialTestCase):
80 """Unit tests for most of the `CodeImportWorkerMonitor` class.
81
82 We have to pay attention to the fact that several of the methods of the
83 `CodeImportWorkerMonitor` class are wrapped in decorators that create and
84 commit a transaction, and have to start our own transactions to check what
85- they did."""
86+ they did.
87+ """
88
89 layer = TwistedLaunchpadZopelessLayer
90
91@@ -320,7 +320,7 @@
92 self.assertEqual(calls, [])
93
94
95-class TestWorkerMonitorRunNoProcess(TestCase):
96+class TestWorkerMonitorRunNoProcess(TrialTestCase, BzrTestCase):
97 """Tests for `CodeImportWorkerMonitor.run` that don't launch a subprocess.
98 """
99
100@@ -435,21 +435,22 @@
101 return protocol
102
103
104-class TestWorkerMonitorIntegration(TestCase, TestCaseWithMemoryTransport):
105+class TestWorkerMonitorIntegration(TrialTestCase, BzrTestCase):
106
107 layer = TwistedLaunchpadZopelessLayer
108
109 def setUp(self):
110- TestCaseWithMemoryTransport.setUp(self)
111+ BzrTestCase.setUp(self)
112 login('no-priv@canonical.com')
113 self.factory = LaunchpadObjectFactory()
114 nuke_codeimport_sample_data()
115 self.repo_path = tempfile.mkdtemp()
116+ self.disable_directory_isolation()
117 self.addCleanup(shutil.rmtree, self.repo_path)
118 self.foreign_commit_count = 0
119
120 def tearDown(self):
121- TestCaseWithMemoryTransport.tearDown(self)
122+ BzrTestCase.tearDown(self)
123 logout()
124
125 def makeCVSCodeImport(self):
126
127=== modified file 'lib/lp/codehosting/puller/tests/__init__.py'
128--- lib/lp/codehosting/puller/tests/__init__.py 2009-07-17 18:46:25 +0000
129+++ lib/lp/codehosting/puller/tests/__init__.py 2009-11-21 02:05:26 +0000
130@@ -116,6 +116,7 @@
131 def setUp(self):
132 TestCaseWithTransport.setUp(self)
133 TestCaseWithFactory.setUp(self)
134+ self.disable_directory_isolation()
135
136 def getHostedPath(self, branch):
137 """Return the path of 'branch' in the upload area."""
138
139=== modified file 'lib/lp/codehosting/puller/tests/test_scheduler.py'
140--- lib/lp/codehosting/puller/tests/test_scheduler.py 2009-09-29 01:54:42 +0000
141+++ lib/lp/codehosting/puller/tests/test_scheduler.py 2009-11-21 02:05:26 +0000
142@@ -8,6 +8,7 @@
143 from datetime import datetime
144 import logging
145 import os
146+import sys
147 import textwrap
148 import unittest
149
150@@ -641,6 +642,14 @@
151 def setUp(self):
152 TrialTestCase.setUp(self)
153 PullerBranchTestCase.setUp(self)
154+ # XXX MichaelHudson, 2009-11-21, bug=464174:
155+ # TestCaseWithMemoryTransport likes to set these environment variables
156+ # to unicode strings and Twisted's spawnProcess doesn't like that
157+ # (reasonably enough).
158+ os.environ['BZR_HOME'] = os.environ['BZR_HOME'].encode(
159+ sys.getfilesystemencoding())
160+ os.environ['HOME'] = os.environ['HOME'].encode(
161+ sys.getfilesystemencoding())
162 self.makeCleanDirectory(config.codehosting.hosted_branches_root)
163 self.makeCleanDirectory(config.codehosting.mirrored_branches_root)
164 branch_id = self.factory.makeAnyBranch(
165
166=== modified file 'lib/lp/codehosting/puller/tests/test_worker.py'
167--- lib/lp/codehosting/puller/tests/test_worker.py 2009-09-18 00:08:40 +0000
168+++ lib/lp/codehosting/puller/tests/test_worker.py 2009-11-21 02:05:26 +0000
169@@ -732,6 +732,7 @@
170 def setUp(self):
171 TestCaseWithTransport.setUp(self)
172 self.saved_factory = bzrlib.ui.ui_factory
173+ self.disable_directory_isolation()
174
175 def tearDown(self):
176 TestCaseWithTransport.tearDown(self)
177
178=== modified file 'lib/lp/codehosting/tests/test_acceptance.py'
179--- lib/lp/codehosting/tests/test_acceptance.py 2009-08-13 15:12:16 +0000
180+++ lib/lp/codehosting/tests/test_acceptance.py 2009-11-21 02:05:26 +0000
181@@ -86,6 +86,7 @@
182
183 def setUp(self):
184 super(SSHTestCase, self).setUp()
185+ self.disable_directory_isolation()
186 tac_handler = SSHServerLayer.getTacHandler()
187 self.server = SSHCodeHostingServer(self.scheme, tac_handler)
188 self.server.setUp()
189
190=== modified file 'lib/lp/codehosting/tests/test_bzrutils.py'
191--- lib/lp/codehosting/tests/test_bzrutils.py 2009-09-18 00:08:40 +0000
192+++ lib/lp/codehosting/tests/test_bzrutils.py 2009-11-21 02:05:26 +0000
193@@ -175,12 +175,16 @@
194 """Tests for `lp.codehosting.bzrutils.get_vfs_format_classes`.
195 """
196
197+ def setUp(self):
198+ TestCaseWithTransport.setUp(self)
199+ self.disable_directory_isolation()
200+
201 def tearDown(self):
202 # This makes sure the connections held by the branches opened in the
203 # test are dropped, so the daemon threads serving those branches can
204 # exit.
205 gc.collect()
206- super(TestGetVfsFormatClasses, self).tearDown()
207+ TestCaseWithTransport.tearDown(self)
208
209 def test_get_vfs_format_classes(self):
210 # get_vfs_format_classes for a returns the underlying format classes
211
212=== modified file 'lib/lp/codehosting/vfs/tests/test_branchfs.py'
213--- lib/lp/codehosting/vfs/tests/test_branchfs.py 2009-10-20 02:36:31 +0000
214+++ lib/lp/codehosting/vfs/tests/test_branchfs.py 2009-11-21 02:05:26 +0000
215@@ -345,6 +345,7 @@
216
217 def setUp(self):
218 BzrTestCase.setUp(self)
219+ self.disable_directory_isolation()
220 MixinBaseLaunchpadServerTests.setUp(self)
221
222 def getLaunchpadServer(self, authserver, user_id):
223
224=== modified file 'lib/lp/codehosting/vfs/tests/test_filesystem.py'
225--- lib/lp/codehosting/vfs/tests/test_filesystem.py 2009-06-25 04:06:00 +0000
226+++ lib/lp/codehosting/vfs/tests/test_filesystem.py 2009-11-21 02:05:26 +0000
227@@ -27,6 +27,7 @@
228
229 def setUp(self):
230 TestCaseWithTransport.setUp(self)
231+ self.disable_directory_isolation()
232 frontend = InMemoryFrontend()
233 self.factory = frontend.getLaunchpadObjectFactory()
234 endpoint = XMLRPCWrapper(frontend.getFilesystemEndpoint())
235
236=== modified file 'versions.cfg'
237--- versions.cfg 2009-11-17 20:34:27 +0000
238+++ versions.cfg 2009-11-21 02:05:26 +0000
239@@ -3,11 +3,7 @@
240
241 [versions]
242 # Alphabetical, case-insensitive, please! :-)
243-#
244-# 4674:lp:~launchpad/bzr/2.0.0-lp
245-# This fixes various oopses.
246-# To generate tarball: "make dist" and rename to taste.
247-bzr = 2.0.0-lp-3
248+bzr = 2.1b3
249 chameleon.core = 1.0b35
250 chameleon.zpt = 1.0b17
251 ClientForm = 0.2.10