Merge lp:~rockstar/launchpad/fix-scan-branches-script into lp:launchpad/db-devel

Proposed by Paul Hummer
Status: Merged
Approved by: Stuart Bishop
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~rockstar/launchpad/fix-scan-branches-script
Merge into: lp:launchpad/db-devel
Diff against target: 74 lines (+8/-7)
3 files modified
configs/testrunner/launchpad-lazr.conf (+1/-1)
lib/lp/code/model/branchjob.py (+3/-2)
lib/lp/codehosting/tests/test_rewrite.py (+4/-4)
To merge this branch: bzr merge lp:~rockstar/launchpad/fix-scan-branches-script
Reviewer Review Type Date Requested Status
Gary Poster (community) rc Approve
Stuart Bishop (community) Approve
Review via email: mp+17869@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

Hi stub-

  Upon QAing the new branch scanner, I found that I was trying to connect to
the hosted and mirrored areas, where the branch scanner really only needs the
mirrored area. In order to make the tests pass, I needed to change a test
config. mwhudson told me that I would want to take my own life if I found out
why, so I just trusted him. The config change broke some tests that I then
fixed.

Cheers,
Paul

Revision history for this message
Stuart Bishop (stub) :
review: Approve
Revision history for this message
Aaron Bentley (abentley) wrote :

I am not sure that this config change is the best approach. In our production environment, we have three internal locations for launchpad branches: read-write hosting, read-only hosting, and mirrored. We should mirror this in our testing environment by providing a read-only hosting location, preferably over http.

Revision history for this message
Gary Poster (gary) :
review: Approve (rc)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configs/testrunner/launchpad-lazr.conf'
2--- configs/testrunner/launchpad-lazr.conf 2010-01-13 18:36:41 +0000
3+++ configs/testrunner/launchpad-lazr.conf 2010-01-22 05:28:17 +0000
4@@ -38,7 +38,7 @@
5 error_dir: /var/tmp/codehosting.test
6 oops_prefix: SMPSSH
7 access_log: /tmp/test-codehosting-access.log
8-internal_branch_by_id_root: file:///var/tmp/bzrsync/
9+internal_branch_by_id_root: file:///var/tmp/bazaar.launchpad.dev/mirrors
10
11 [create_merge_proposals]
12 oops_prefix: TMPCJ
13
14=== modified file 'lib/lp/code/model/branchjob.py'
15--- lib/lp/code/model/branchjob.py 2010-01-22 03:16:44 +0000
16+++ lib/lp/code/model/branchjob.py 2010-01-22 05:28:17 +0000
17@@ -52,7 +52,8 @@
18 from lp.code.model.diff import StaticDiff
19 from lp.code.model.revision import RevisionSet
20 from lp.codehosting.scanner.bzrsync import BzrSync
21-from lp.codehosting.vfs import branch_id_to_path, get_multi_server
22+from lp.codehosting.vfs import (branch_id_to_path, get_multi_server,
23+ get_scanner_server)
24 from lp.services.job.model.job import Job
25 from lp.services.job.interfaces.job import JobStatus
26 from lp.services.job.runner import BaseRunnableJob
27@@ -283,7 +284,7 @@
28 def contextManager():
29 """See `IBranchScanJobSource`."""
30 errorlog.globalErrorUtility.configure('branchscanner')
31- server = get_multi_server()
32+ server = get_scanner_server()
33 server.setUp()
34 yield
35 server.tearDown()
36
37=== modified file 'lib/lp/codehosting/tests/test_rewrite.py'
38--- lib/lp/codehosting/tests/test_rewrite.py 2010-01-07 06:40:23 +0000
39+++ lib/lp/codehosting/tests/test_rewrite.py 2010-01-22 05:28:17 +0000
40@@ -50,7 +50,7 @@
41 rewriter.rewriteLine("/%s/.bzr/README" % branch.unique_name)
42 for branch in branches]
43 expected = [
44- 'file:///var/tmp/bzrsync/%s/.bzr/README'
45+ 'file:///var/tmp/bazaar.launchpad.dev/mirrors/%s/.bzr/README'
46 % branch_id_to_path(branch.id)
47 for branch in branches]
48 self.assertEqual(expected, output)
49@@ -179,7 +179,7 @@
50 "/%s/.bzr/README" % branch.unique_name for branch in branches] + [
51 "/%s/changes" % branch.unique_name for branch in branches]
52 expected_lines = [
53- 'file:///var/tmp/bzrsync/%s/.bzr/README'
54+ 'file:///var/tmp/bazaar.launchpad.dev/mirrors/%s/.bzr/README'
55 % branch_id_to_path(branch.id)
56 for branch in branches] + [
57 'http://localhost:8080/%s/changes' % branch.unique_name
58@@ -206,14 +206,14 @@
59
60 new_branch_input = '/%s/.bzr/README' % new_branch.unique_name
61 expected_lines.append(
62- 'file:///var/tmp/bzrsync/%s/.bzr/README'
63+ 'file:///var/tmp/bazaar.launchpad.dev/mirrors/%s/.bzr/README'
64 % branch_id_to_path(new_branch.id))
65 proc.stdin.write(new_branch_input + '\n')
66 output_lines.append(proc.stdout.readline().rstrip('\n'))
67
68 edited_branch_input = '/%s/.bzr/README' % edited_branch.unique_name
69 expected_lines.append(
70- 'file:///var/tmp/bzrsync/%s/.bzr/README'
71+ 'file:///var/tmp/bazaar.launchpad.dev/mirrors/%s/.bzr/README'
72 % branch_id_to_path(edited_branch.id))
73 proc.stdin.write(edited_branch_input + '\n')
74 output_lines.append(proc.stdout.readline().rstrip('\n'))

Subscribers

People subscribed via source and target branches

to status/vote changes: