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
=== modified file 'lib/devscripts/tests/test_sourcecode.py'
--- lib/devscripts/tests/test_sourcecode.py 2009-09-30 11:56:28 +0000
+++ lib/devscripts/tests/test_sourcecode.py 2009-11-21 02:05:26 +0000
@@ -147,6 +147,10 @@
147class TestFindBranches(TestCase):147class TestFindBranches(TestCase):
148 """Tests the way that we find branches."""148 """Tests the way that we find branches."""
149149
150 def setUp(self):
151 TestCase.setUp(self)
152 self.disable_directory_isolation()
153
150 def makeBranch(self, path):154 def makeBranch(self, path):
151 transport = get_transport(path)155 transport = get_transport(path)
152 transport.ensure_base()156 transport.ensure_base()
153157
=== modified file 'lib/lp/code/model/tests/test_branchjob.py'
--- lib/lp/code/model/tests/test_branchjob.py 2009-10-26 21:03:00 +0000
+++ lib/lp/code/model/tests/test_branchjob.py 2009-11-21 02:05:26 +0000
@@ -526,7 +526,7 @@
526 tree.merge_from_branch(tree2.branch)526 tree.merge_from_branch(tree2.branch)
527 tree3 = tree.bzrdir.sprout('tree3').open_workingtree()527 tree3 = tree.bzrdir.sprout('tree3').open_workingtree()
528 tree3.commit('rev2b', rev_id='rev2b-id', committer='qux@')528 tree3.commit('rev2b', rev_id='rev2b-id', committer='qux@')
529 tree.merge_from_branch(tree3.branch)529 tree.merge_from_branch(tree3.branch, force=True)
530 if include_ghost:530 if include_ghost:
531 tree.add_parent_tree_id('rev2c-id')531 tree.add_parent_tree_id('rev2c-id')
532 tree.commit('rev2d', rev_id='rev2d-id', timestamp=1000, timezone=0,532 tree.commit('rev2d', rev_id='rev2d-id', timestamp=1000, timezone=0,
533533
=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
--- lib/lp/codehosting/codeimport/tests/test_worker.py 2009-09-18 01:36:48 +0000
+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2009-11-21 02:05:26 +0000
@@ -49,6 +49,10 @@
4949
50 layer = BaseLayer50 layer = BaseLayer
5151
52 def setUp(self):
53 TestCaseWithTransport.setUp(self)
54 self.disable_directory_isolation()
55
52 def assertDirectoryTreesEqual(self, directory1, directory2):56 def assertDirectoryTreesEqual(self, directory1, directory2):
53 """Assert that `directory1` has the same structure as `directory2`.57 """Assert that `directory1` has the same structure as `directory2`.
5458
5559
=== modified file 'lib/lp/codehosting/codeimport/tests/test_workermonitor.py'
--- lib/lp/codehosting/codeimport/tests/test_workermonitor.py 2009-09-16 00:28:31 +0000
+++ lib/lp/codehosting/codeimport/tests/test_workermonitor.py 2009-11-21 02:05:26 +0000
@@ -11,15 +11,14 @@
11import os11import os
12import shutil12import shutil
13import StringIO13import StringIO
14import sys
15import tempfile14import tempfile
16import unittest15import unittest
1716
18from bzrlib.branch import Branch17from bzrlib.branch import Branch
19from bzrlib.tests import TestCaseWithMemoryTransport18from bzrlib.tests import TestCase as BzrTestCase
2019
21from twisted.internet import defer, error, protocol, reactor20from twisted.internet import defer, error, protocol, reactor
22from twisted.trial.unittest import TestCase21from twisted.trial.unittest import TestCase as TrialTestCase
2322
24from zope.component import getUtility23from zope.component import getUtility
25from zope.security.proxy import removeSecurityProxy24from zope.security.proxy import removeSecurityProxy
@@ -49,7 +48,7 @@
49from lp.testing.factory import LaunchpadObjectFactory48from lp.testing.factory import LaunchpadObjectFactory
5049
5150
52class TestWorkerMonitorProtocol(ProcessTestsMixin, TestCase):51class TestWorkerMonitorProtocol(ProcessTestsMixin, TrialTestCase):
5352
54 layer = TwistedLayer53 layer = TwistedLayer
5554
@@ -127,13 +126,14 @@
127 self.protocol._tail, 'line 3\nline 4\nline 5\nline 6\n')126 self.protocol._tail, 'line 3\nline 4\nline 5\nline 6\n')
128127
129128
130class TestWorkerMonitorUnit(TestCase):129class TestWorkerMonitorUnit(TrialTestCase):
131 """Unit tests for most of the `CodeImportWorkerMonitor` class.130 """Unit tests for most of the `CodeImportWorkerMonitor` class.
132131
133 We have to pay attention to the fact that several of the methods of the132 We have to pay attention to the fact that several of the methods of the
134 `CodeImportWorkerMonitor` class are wrapped in decorators that create and133 `CodeImportWorkerMonitor` class are wrapped in decorators that create and
135 commit a transaction, and have to start our own transactions to check what134 commit a transaction, and have to start our own transactions to check what
136 they did."""135 they did.
136 """
137137
138 layer = TwistedLaunchpadZopelessLayer138 layer = TwistedLaunchpadZopelessLayer
139139
@@ -320,7 +320,7 @@
320 self.assertEqual(calls, [])320 self.assertEqual(calls, [])
321321
322322
323class TestWorkerMonitorRunNoProcess(TestCase):323class TestWorkerMonitorRunNoProcess(TrialTestCase, BzrTestCase):
324 """Tests for `CodeImportWorkerMonitor.run` that don't launch a subprocess.324 """Tests for `CodeImportWorkerMonitor.run` that don't launch a subprocess.
325 """325 """
326326
@@ -435,21 +435,22 @@
435 return protocol435 return protocol
436436
437437
438class TestWorkerMonitorIntegration(TestCase, TestCaseWithMemoryTransport):438class TestWorkerMonitorIntegration(TrialTestCase, BzrTestCase):
439439
440 layer = TwistedLaunchpadZopelessLayer440 layer = TwistedLaunchpadZopelessLayer
441441
442 def setUp(self):442 def setUp(self):
443 TestCaseWithMemoryTransport.setUp(self)443 BzrTestCase.setUp(self)
444 login('no-priv@canonical.com')444 login('no-priv@canonical.com')
445 self.factory = LaunchpadObjectFactory()445 self.factory = LaunchpadObjectFactory()
446 nuke_codeimport_sample_data()446 nuke_codeimport_sample_data()
447 self.repo_path = tempfile.mkdtemp()447 self.repo_path = tempfile.mkdtemp()
448 self.disable_directory_isolation()
448 self.addCleanup(shutil.rmtree, self.repo_path)449 self.addCleanup(shutil.rmtree, self.repo_path)
449 self.foreign_commit_count = 0450 self.foreign_commit_count = 0
450451
451 def tearDown(self):452 def tearDown(self):
452 TestCaseWithMemoryTransport.tearDown(self)453 BzrTestCase.tearDown(self)
453 logout()454 logout()
454455
455 def makeCVSCodeImport(self):456 def makeCVSCodeImport(self):
456457
=== modified file 'lib/lp/codehosting/puller/tests/__init__.py'
--- lib/lp/codehosting/puller/tests/__init__.py 2009-07-17 18:46:25 +0000
+++ lib/lp/codehosting/puller/tests/__init__.py 2009-11-21 02:05:26 +0000
@@ -116,6 +116,7 @@
116 def setUp(self):116 def setUp(self):
117 TestCaseWithTransport.setUp(self)117 TestCaseWithTransport.setUp(self)
118 TestCaseWithFactory.setUp(self)118 TestCaseWithFactory.setUp(self)
119 self.disable_directory_isolation()
119120
120 def getHostedPath(self, branch):121 def getHostedPath(self, branch):
121 """Return the path of 'branch' in the upload area."""122 """Return the path of 'branch' in the upload area."""
122123
=== modified file 'lib/lp/codehosting/puller/tests/test_scheduler.py'
--- lib/lp/codehosting/puller/tests/test_scheduler.py 2009-09-29 01:54:42 +0000
+++ lib/lp/codehosting/puller/tests/test_scheduler.py 2009-11-21 02:05:26 +0000
@@ -8,6 +8,7 @@
8from datetime import datetime8from datetime import datetime
9import logging9import logging
10import os10import os
11import sys
11import textwrap12import textwrap
12import unittest13import unittest
1314
@@ -641,6 +642,14 @@
641 def setUp(self):642 def setUp(self):
642 TrialTestCase.setUp(self)643 TrialTestCase.setUp(self)
643 PullerBranchTestCase.setUp(self)644 PullerBranchTestCase.setUp(self)
645 # XXX MichaelHudson, 2009-11-21, bug=464174:
646 # TestCaseWithMemoryTransport likes to set these environment variables
647 # to unicode strings and Twisted's spawnProcess doesn't like that
648 # (reasonably enough).
649 os.environ['BZR_HOME'] = os.environ['BZR_HOME'].encode(
650 sys.getfilesystemencoding())
651 os.environ['HOME'] = os.environ['HOME'].encode(
652 sys.getfilesystemencoding())
644 self.makeCleanDirectory(config.codehosting.hosted_branches_root)653 self.makeCleanDirectory(config.codehosting.hosted_branches_root)
645 self.makeCleanDirectory(config.codehosting.mirrored_branches_root)654 self.makeCleanDirectory(config.codehosting.mirrored_branches_root)
646 branch_id = self.factory.makeAnyBranch(655 branch_id = self.factory.makeAnyBranch(
647656
=== modified file 'lib/lp/codehosting/puller/tests/test_worker.py'
--- lib/lp/codehosting/puller/tests/test_worker.py 2009-09-18 00:08:40 +0000
+++ lib/lp/codehosting/puller/tests/test_worker.py 2009-11-21 02:05:26 +0000
@@ -732,6 +732,7 @@
732 def setUp(self):732 def setUp(self):
733 TestCaseWithTransport.setUp(self)733 TestCaseWithTransport.setUp(self)
734 self.saved_factory = bzrlib.ui.ui_factory734 self.saved_factory = bzrlib.ui.ui_factory
735 self.disable_directory_isolation()
735736
736 def tearDown(self):737 def tearDown(self):
737 TestCaseWithTransport.tearDown(self)738 TestCaseWithTransport.tearDown(self)
738739
=== modified file 'lib/lp/codehosting/tests/test_acceptance.py'
--- lib/lp/codehosting/tests/test_acceptance.py 2009-08-13 15:12:16 +0000
+++ lib/lp/codehosting/tests/test_acceptance.py 2009-11-21 02:05:26 +0000
@@ -86,6 +86,7 @@
8686
87 def setUp(self):87 def setUp(self):
88 super(SSHTestCase, self).setUp()88 super(SSHTestCase, self).setUp()
89 self.disable_directory_isolation()
89 tac_handler = SSHServerLayer.getTacHandler()90 tac_handler = SSHServerLayer.getTacHandler()
90 self.server = SSHCodeHostingServer(self.scheme, tac_handler)91 self.server = SSHCodeHostingServer(self.scheme, tac_handler)
91 self.server.setUp()92 self.server.setUp()
9293
=== modified file 'lib/lp/codehosting/tests/test_bzrutils.py'
--- lib/lp/codehosting/tests/test_bzrutils.py 2009-09-18 00:08:40 +0000
+++ lib/lp/codehosting/tests/test_bzrutils.py 2009-11-21 02:05:26 +0000
@@ -175,12 +175,16 @@
175 """Tests for `lp.codehosting.bzrutils.get_vfs_format_classes`.175 """Tests for `lp.codehosting.bzrutils.get_vfs_format_classes`.
176 """176 """
177177
178 def setUp(self):
179 TestCaseWithTransport.setUp(self)
180 self.disable_directory_isolation()
181
178 def tearDown(self):182 def tearDown(self):
179 # This makes sure the connections held by the branches opened in the183 # This makes sure the connections held by the branches opened in the
180 # test are dropped, so the daemon threads serving those branches can184 # test are dropped, so the daemon threads serving those branches can
181 # exit.185 # exit.
182 gc.collect()186 gc.collect()
183 super(TestGetVfsFormatClasses, self).tearDown()187 TestCaseWithTransport.tearDown(self)
184188
185 def test_get_vfs_format_classes(self):189 def test_get_vfs_format_classes(self):
186 # get_vfs_format_classes for a returns the underlying format classes190 # get_vfs_format_classes for a returns the underlying format classes
187191
=== modified file 'lib/lp/codehosting/vfs/tests/test_branchfs.py'
--- lib/lp/codehosting/vfs/tests/test_branchfs.py 2009-10-20 02:36:31 +0000
+++ lib/lp/codehosting/vfs/tests/test_branchfs.py 2009-11-21 02:05:26 +0000
@@ -345,6 +345,7 @@
345345
346 def setUp(self):346 def setUp(self):
347 BzrTestCase.setUp(self)347 BzrTestCase.setUp(self)
348 self.disable_directory_isolation()
348 MixinBaseLaunchpadServerTests.setUp(self)349 MixinBaseLaunchpadServerTests.setUp(self)
349350
350 def getLaunchpadServer(self, authserver, user_id):351 def getLaunchpadServer(self, authserver, user_id):
351352
=== modified file 'lib/lp/codehosting/vfs/tests/test_filesystem.py'
--- lib/lp/codehosting/vfs/tests/test_filesystem.py 2009-06-25 04:06:00 +0000
+++ lib/lp/codehosting/vfs/tests/test_filesystem.py 2009-11-21 02:05:26 +0000
@@ -27,6 +27,7 @@
2727
28 def setUp(self):28 def setUp(self):
29 TestCaseWithTransport.setUp(self)29 TestCaseWithTransport.setUp(self)
30 self.disable_directory_isolation()
30 frontend = InMemoryFrontend()31 frontend = InMemoryFrontend()
31 self.factory = frontend.getLaunchpadObjectFactory()32 self.factory = frontend.getLaunchpadObjectFactory()
32 endpoint = XMLRPCWrapper(frontend.getFilesystemEndpoint())33 endpoint = XMLRPCWrapper(frontend.getFilesystemEndpoint())
3334
=== modified file 'versions.cfg'
--- versions.cfg 2009-11-17 20:34:27 +0000
+++ versions.cfg 2009-11-21 02:05:26 +0000
@@ -3,11 +3,7 @@
33
4[versions]4[versions]
5# Alphabetical, case-insensitive, please! :-)5# Alphabetical, case-insensitive, please! :-)
6#6bzr = 2.1b3
7# 4674:lp:~launchpad/bzr/2.0.0-lp
8# This fixes various oopses.
9# To generate tarball: "make dist" and rename to taste.
10bzr = 2.0.0-lp-3
11chameleon.core = 1.0b357chameleon.core = 1.0b35
12chameleon.zpt = 1.0b178chameleon.zpt = 1.0b17
13ClientForm = 0.2.109ClientForm = 0.2.10