launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #32764
[Merge] ~tushar5526/lp-codeimport:fix-the-rest-of-integration-tests into lp-codeimport:focal
Tushar Gupta has proposed merging ~tushar5526/lp-codeimport:fix-the-rest-of-integration-tests into lp-codeimport:focal with ~tushar5526/lp-codeimport:move-to-kombu-from-amqp as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~tushar5526/lp-codeimport/+git/lp-codeimport/+merge/489199
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~tushar5526/lp-codeimport:fix-the-rest-of-integration-tests into lp-codeimport:focal.
diff --git a/lib/lp/codehosting/codeimport/tests/servers.py b/lib/lp/codehosting/codeimport/tests/servers.py
index e9583b2..33a643b 100644
--- a/lib/lp/codehosting/codeimport/tests/servers.py
+++ b/lib/lp/codehosting/codeimport/tests/servers.py
@@ -152,7 +152,7 @@ class HTTPGitServerThread(threading.Thread):
self.name = "HTTP Git server on %s:%s" % (address, port)
app = HTTPGitApplication(
backend,
- handlers={'turnip-set-symbolic-ref': TurnipSetSymbolicRefHandler})
+ handlers={b'turnip-set-symbolic-ref': TurnipSetSymbolicRefHandler})
app.services[('POST', re.compile('/turnip-set-symbolic-ref$'))] = (
handle_service_request)
app = GunzipFilter(LimitedInputFilter(app))
diff --git a/lib/lp/codehosting/codeimport/tests/test_worker.py b/lib/lp/codehosting/codeimport/tests/test_worker.py
index 5a54b0f..238f83a 100644
--- a/lib/lp/codehosting/codeimport/tests/test_worker.py
+++ b/lib/lp/codehosting/codeimport/tests/test_worker.py
@@ -386,9 +386,8 @@ class TestBazaarBranchStore(WorkerTest):
builder = self.make_branch_builder('tree')
revid = builder.build_snapshot(
None, [('add', ('', b'root-id', 'directory', ''))])
- print(revid, type(revid))
- revid1 = builder.build_snapshot(None, [], [])
- revid2 = builder.build_snapshot(None, [revid], [])
+ revid1 = builder.build_snapshot([revid], [])
+ revid2 = builder.build_snapshot([revid], [])
store = self.makeBranchStore()
store.push(
self.arbitrary_branch_id, builder.get_branch(), default_format)
diff --git a/lib/lp/codehosting/codeimport/tests/test_workermonitor.py b/lib/lp/codehosting/codeimport/tests/test_workermonitor.py
index b622a9a..e38dece 100644
--- a/lib/lp/codehosting/codeimport/tests/test_workermonitor.py
+++ b/lib/lp/codehosting/codeimport/tests/test_workermonitor.py
@@ -761,9 +761,9 @@ class TestWorkerMonitorIntegration(FakeCodeImportSchedulerMixin,
self.assertImported(job_id, job_data)
target_repo = GitRepo(target_repo_path)
self.assertContentEqual(
- ["heads/master"], target_repo.refs.keys(base="refs"))
+ [b"heads/master"], target_repo.refs.keys(base=b"refs"))
self.assertEqual(
- "ref: refs/heads/master", target_repo.refs.read_ref("HEAD"))
+ b"ref: refs/heads/master", target_repo.refs.read_ref(b"HEAD"))
@defer.inlineCallbacks
def test_import_git_to_git_refs_changed(self):
@@ -786,10 +786,10 @@ class TestWorkerMonitorIntegration(FakeCodeImportSchedulerMixin,
self.assertImported(job_id, job_data)
target_repo = GitRepo(target_repo_path)
self.assertContentEqual(
- ["heads/one", "heads/two"], target_repo.refs.keys(base="refs"))
+ [b"heads/one", b"heads/two"], target_repo.refs.keys(base=b"refs"))
self.assertEqual(
- "ref: refs/heads/one",
- GitRepo(target_repo_path).refs.read_ref("HEAD"))
+ b"ref: refs/heads/one",
+ GitRepo(target_repo_path).refs.read_ref(b"HEAD"))
class DeferredOnExit(protocol.ProcessProtocol):
@@ -825,7 +825,7 @@ class TestWorkerMonitorIntegrationScript(TestWorkerMonitorIntegration):
config_fixture.add_section(dedent("""
[codeimportdispatcher]
codeimportscheduler_url: %s
- """) % scheduler_url)
+ """) % scheduler_url.decode('utf-8'))
self.useFixture(ConfigUseFixture(config_name))
script_path = os.path.join(
config.root, 'scripts', 'code-import-worker-monitor.py')
diff --git a/lib/lp/codehosting/codeimport/worker.py b/lib/lp/codehosting/codeimport/worker.py
index 4d48603..93d6083 100644
--- a/lib/lp/codehosting/codeimport/worker.py
+++ b/lib/lp/codehosting/codeimport/worker.py
@@ -975,7 +975,7 @@ class GitToGitImportWorker(ImportWorker):
headers = {
"Content-Type": "application/x-%s-request" % service,
}
- body = pkt_line("HEAD %s" % target_ref) + pkt_line(None)
+ body = pkt_line(("HEAD %s" % target_ref).encode("utf-8")) + pkt_line(None)
try:
response = urlfetch(url, method="POST", headers=headers, data=body)
raise_for_status_redacted(response)