diff --git a/tests/base.py b/tests/base.py index f631ec3f10..d5fd7b8816 100755 --- a/tests/base.py +++ b/tests/base.py @@ -1195,7 +1195,8 @@ class ZuulTestCase(BaseTestCase): tmp_root = os.environ.get("ZUUL_TEST_ROOT") self.test_root = os.path.join(tmp_root, "zuul-test") self.upstream_root = os.path.join(self.test_root, "upstream") - self.git_root = os.path.join(self.test_root, "git") + self.merger_git_root = os.path.join(self.test_root, "merger-git") + self.launcher_git_root = os.path.join(self.test_root, "launcher-git") self.state_root = os.path.join(self.test_root, "lib") if os.path.exists(self.test_root): @@ -1209,7 +1210,8 @@ class ZuulTestCase(BaseTestCase): self.config.set('zuul', 'tenant_config', os.path.join(FIXTURE_DIR, self.config.get('zuul', 'tenant_config'))) - self.config.set('merger', 'git_dir', self.git_root) + self.config.set('merger', 'git_dir', self.merger_git_root) + self.config.set('launcher', 'git_dir', self.launcher_git_root) self.config.set('zuul', 'state_dir', self.state_root) # For each project in config: diff --git a/tests/fixtures/zuul-connections-multiple-gerrits.conf b/tests/fixtures/zuul-connections-multiple-gerrits.conf index 89f0aa6e69..3e6850d3ca 100644 --- a/tests/fixtures/zuul-connections-multiple-gerrits.conf +++ b/tests/fixtures/zuul-connections-multiple-gerrits.conf @@ -7,11 +7,14 @@ url_pattern=http://logs.example.com/{change.number}/{change.patchset}/{pipeline. job_name_in_report=true [merger] -git_dir=/tmp/zuul-test/git +git_dir=/tmp/zuul-test/merger-git git_user_email=zuul@example.com git_user_name=zuul zuul_url=http://zuul.example.com/p +[launcher] +git_dir=/tmp/zuul-test/launcher-git + [swift] authurl=https://identity.api.example.org/v2.0/ user=username diff --git a/tests/fixtures/zuul-connections-same-gerrit.conf b/tests/fixtures/zuul-connections-same-gerrit.conf index 43109d2c7b..57b5182d6b 100644 --- a/tests/fixtures/zuul-connections-same-gerrit.conf +++ b/tests/fixtures/zuul-connections-same-gerrit.conf @@ -7,11 +7,14 @@ url_pattern=http://logs.example.com/{change.number}/{change.patchset}/{pipeline. job_name_in_report=true [merger] -git_dir=/tmp/zuul-test/git +git_dir=/tmp/zuul-test/merger-git git_user_email=zuul@example.com git_user_name=zuul zuul_url=http://zuul.example.com/p +[launcher] +git_dir=/tmp/zuul-test/launcher-git + [swift] authurl=https://identity.api.example.org/v2.0/ user=username diff --git a/tests/fixtures/zuul.conf b/tests/fixtures/zuul.conf index c08b5adf3c..48129d8988 100644 --- a/tests/fixtures/zuul.conf +++ b/tests/fixtures/zuul.conf @@ -7,11 +7,14 @@ url_pattern=http://logs.example.com/{change.number}/{change.patchset}/{pipeline. job_name_in_report=true [merger] -git_dir=/tmp/zuul-test/git +git_dir=/tmp/zuul-test/merger-git git_user_email=zuul@example.com git_user_name=zuul zuul_url=http://zuul.example.com/p +[launcher] +git_dir=/tmp/zuul-test/launcher-git + [swift] authurl=https://identity.api.example.org/v2.0/ user=username diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py index 309b815f5b..f88b1a4e51 100755 --- a/tests/unit/test_scheduler.py +++ b/tests/unit/test_scheduler.py @@ -1377,8 +1377,12 @@ class TestScheduler(ZuulTestCase): self.assertEmptyQueues() self.build_history = [] - path = os.path.join(self.git_root, "org/project") - print(repack_repo(path)) + path = os.path.join(self.merger_git_root, "org/project") + if os.path.exists(path): + repack_repo(path) + path = os.path.join(self.launcher_git_root, "org/project") + if os.path.exists(path): + repack_repo(path) A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A') A.addApproval('code-review', 2) @@ -1404,9 +1408,13 @@ class TestScheduler(ZuulTestCase): A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A') A.addPatchset(large=True) path = os.path.join(self.upstream_root, "org/project1") - print(repack_repo(path)) - path = os.path.join(self.git_root, "org/project1") - print(repack_repo(path)) + repack_repo(path) + path = os.path.join(self.merger_git_root, "org/project1") + if os.path.exists(path): + repack_repo(path) + path = os.path.join(self.launcher_git_root, "org/project1") + if os.path.exists(path): + repack_repo(path) A.addApproval('code-review', 2) self.fake_gerrit.addEvent(A.addApproval('approved', 1)) @@ -2668,7 +2676,11 @@ class TestScheduler(ZuulTestCase): self.assertEqual(A.reported, 2) # Delete org/new-project zuul repo. Should be recloned. - shutil.rmtree(os.path.join(self.git_root, "org/delete-project")) + p = 'org/delete-project' + if os.path.exists(os.path.join(self.merger_git_root, p)): + shutil.rmtree(os.path.join(self.merger_git_root, p)) + if os.path.exists(os.path.join(self.launcher_git_root, p)): + shutil.rmtree(os.path.join(self.launcher_git_root, p)) B = self.fake_gerrit.addFakeChange('org/delete-project', 'master', 'B') diff --git a/zuul/launcher/server.py b/zuul/launcher/server.py index e9ec1b9fb7..df71cc9526 100644 --- a/zuul/launcher/server.py +++ b/zuul/launcher/server.py @@ -208,10 +208,10 @@ class LaunchServer(object): unverbose=self.verboseOff, ) - if self.config.has_option('merger', 'git_dir'): - self.merge_root = self.config.get('merger', 'git_dir') + if self.config.has_option('launcher', 'git_dir'): + self.merge_root = self.config.get('launcher', 'git_dir') else: - self.merge_root = '/var/lib/zuul/git' + self.merge_root = '/var/lib/zuul/launcher-git' if self.config.has_option('merger', 'git_user_email'): self.merge_email = self.config.get('merger', 'git_user_email') diff --git a/zuul/merger/server.py b/zuul/merger/server.py index 750d560f01..ecce2cf4fb 100644 --- a/zuul/merger/server.py +++ b/zuul/merger/server.py @@ -32,7 +32,7 @@ class MergeServer(object): if self.config.has_option('merger', 'git_dir'): merge_root = self.config.get('merger', 'git_dir') else: - merge_root = '/var/lib/zuul/git' + merge_root = '/var/lib/zuul/merger-git' if self.config.has_option('merger', 'git_user_email'): merge_email = self.config.get('merger', 'git_user_email')