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
=== modified file 'configs/testrunner/launchpad-lazr.conf'
--- configs/testrunner/launchpad-lazr.conf 2010-01-13 18:36:41 +0000
+++ configs/testrunner/launchpad-lazr.conf 2010-01-22 05:28:17 +0000
@@ -38,7 +38,7 @@
38error_dir: /var/tmp/codehosting.test38error_dir: /var/tmp/codehosting.test
39oops_prefix: SMPSSH39oops_prefix: SMPSSH
40access_log: /tmp/test-codehosting-access.log40access_log: /tmp/test-codehosting-access.log
41internal_branch_by_id_root: file:///var/tmp/bzrsync/41internal_branch_by_id_root: file:///var/tmp/bazaar.launchpad.dev/mirrors
4242
43[create_merge_proposals]43[create_merge_proposals]
44oops_prefix: TMPCJ44oops_prefix: TMPCJ
4545
=== modified file 'lib/lp/code/model/branchjob.py'
--- lib/lp/code/model/branchjob.py 2010-01-22 03:16:44 +0000
+++ lib/lp/code/model/branchjob.py 2010-01-22 05:28:17 +0000
@@ -52,7 +52,8 @@
52from lp.code.model.diff import StaticDiff52from lp.code.model.diff import StaticDiff
53from lp.code.model.revision import RevisionSet53from lp.code.model.revision import RevisionSet
54from lp.codehosting.scanner.bzrsync import BzrSync54from lp.codehosting.scanner.bzrsync import BzrSync
55from lp.codehosting.vfs import branch_id_to_path, get_multi_server55from lp.codehosting.vfs import (branch_id_to_path, get_multi_server,
56 get_scanner_server)
56from lp.services.job.model.job import Job57from lp.services.job.model.job import Job
57from lp.services.job.interfaces.job import JobStatus58from lp.services.job.interfaces.job import JobStatus
58from lp.services.job.runner import BaseRunnableJob59from lp.services.job.runner import BaseRunnableJob
@@ -283,7 +284,7 @@
283 def contextManager():284 def contextManager():
284 """See `IBranchScanJobSource`."""285 """See `IBranchScanJobSource`."""
285 errorlog.globalErrorUtility.configure('branchscanner')286 errorlog.globalErrorUtility.configure('branchscanner')
286 server = get_multi_server()287 server = get_scanner_server()
287 server.setUp()288 server.setUp()
288 yield289 yield
289 server.tearDown()290 server.tearDown()
290291
=== modified file 'lib/lp/codehosting/tests/test_rewrite.py'
--- lib/lp/codehosting/tests/test_rewrite.py 2010-01-07 06:40:23 +0000
+++ lib/lp/codehosting/tests/test_rewrite.py 2010-01-22 05:28:17 +0000
@@ -50,7 +50,7 @@
50 rewriter.rewriteLine("/%s/.bzr/README" % branch.unique_name)50 rewriter.rewriteLine("/%s/.bzr/README" % branch.unique_name)
51 for branch in branches]51 for branch in branches]
52 expected = [52 expected = [
53 'file:///var/tmp/bzrsync/%s/.bzr/README'53 'file:///var/tmp/bazaar.launchpad.dev/mirrors/%s/.bzr/README'
54 % branch_id_to_path(branch.id)54 % branch_id_to_path(branch.id)
55 for branch in branches]55 for branch in branches]
56 self.assertEqual(expected, output)56 self.assertEqual(expected, output)
@@ -179,7 +179,7 @@
179 "/%s/.bzr/README" % branch.unique_name for branch in branches] + [179 "/%s/.bzr/README" % branch.unique_name for branch in branches] + [
180 "/%s/changes" % branch.unique_name for branch in branches]180 "/%s/changes" % branch.unique_name for branch in branches]
181 expected_lines = [181 expected_lines = [
182 'file:///var/tmp/bzrsync/%s/.bzr/README'182 'file:///var/tmp/bazaar.launchpad.dev/mirrors/%s/.bzr/README'
183 % branch_id_to_path(branch.id)183 % branch_id_to_path(branch.id)
184 for branch in branches] + [184 for branch in branches] + [
185 'http://localhost:8080/%s/changes' % branch.unique_name185 'http://localhost:8080/%s/changes' % branch.unique_name
@@ -206,14 +206,14 @@
206206
207 new_branch_input = '/%s/.bzr/README' % new_branch.unique_name207 new_branch_input = '/%s/.bzr/README' % new_branch.unique_name
208 expected_lines.append(208 expected_lines.append(
209 'file:///var/tmp/bzrsync/%s/.bzr/README'209 'file:///var/tmp/bazaar.launchpad.dev/mirrors/%s/.bzr/README'
210 % branch_id_to_path(new_branch.id))210 % branch_id_to_path(new_branch.id))
211 proc.stdin.write(new_branch_input + '\n')211 proc.stdin.write(new_branch_input + '\n')
212 output_lines.append(proc.stdout.readline().rstrip('\n'))212 output_lines.append(proc.stdout.readline().rstrip('\n'))
213213
214 edited_branch_input = '/%s/.bzr/README' % edited_branch.unique_name214 edited_branch_input = '/%s/.bzr/README' % edited_branch.unique_name
215 expected_lines.append(215 expected_lines.append(
216 'file:///var/tmp/bzrsync/%s/.bzr/README'216 'file:///var/tmp/bazaar.launchpad.dev/mirrors/%s/.bzr/README'
217 % branch_id_to_path(edited_branch.id))217 % branch_id_to_path(edited_branch.id))
218 proc.stdin.write(edited_branch_input + '\n')218 proc.stdin.write(edited_branch_input + '\n')
219 output_lines.append(proc.stdout.readline().rstrip('\n'))219 output_lines.append(proc.stdout.readline().rstrip('\n'))

Subscribers

People subscribed via source and target branches

to status/vote changes: