From 7a27b238b697e0c36b1de240174e08ff920d508c Mon Sep 17 00:00:00 2001 From: Mason Test Runner Date: Wed, 17 Dec 2014 11:17:23 +0000 Subject: Fix build_test.py to deploy from repo in /var/lib/zuul/gits The code here is copied and pasted from build.py, and should really be factored out into a base class. --- mason/tests/build_test.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/mason/tests/build_test.py b/mason/tests/build_test.py index 9487244..a50eef7 100644 --- a/mason/tests/build_test.py +++ b/mason/tests/build_test.py @@ -126,13 +126,6 @@ class Runner(mason.runners.JobRunner): self.workspace = '/root/mason-workspace' self.zuul_url = self.job_arguments['ZUUL_URL'] - url = urlparse.urlparse(self.zuul_url) - self.defs_checkout = os.path.join(self.workspace, - self.commit, - url.hostname, - '8080', - self.project) - self._do_git_config() if os.path.exists(self.workspace): @@ -140,9 +133,23 @@ class Runner(mason.runners.JobRunner): cliapp.runcmd(['morph', 'init', self.workspace]) - repo = 'http://%s:8080/%s' % (url.hostname, self.project) - cliapp.runcmd(['morph', 'checkout', repo, self.commit], + zuul_gits_dir = 'var/lib/zuul/git/' + + repo_dir = os.path.join('/', zuul_gits_dir, self.project) + cliapp.runcmd(['morph', 'checkout', repo_dir, self.commit], cwd=self.workspace) + + # Morph allows us to rename the system branch directory from the + # ludicrously long name that it chose for us. + temp_defs_checkout = os.path.join( + self.workspace, self.commit, zuul_gits_dir, self.project) + self.defs_checkout = os.path.join( + self.workspace, self.commit, self.project) + logging.debug( + 'Renaming system-branch directory from %s to %s', + temp_defs_checkout, self.defs_checkout) + os.renames(temp_defs_checkout, self.defs_checkout) + self.morph_helper = mason.util.MorphologyHelper(self.defs_checkout) @mason.util.job_step -- cgit v1.2.1