From b0895a3629e52ed4242aa1feedb9fc5d90c1af62 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 16 Jun 2015 10:38:11 +0000 Subject: [PATCH] implement teuthology_path similar to suite_path In case we want to reference a local directory instead of reseting from a clone of teuthology. Signed-off-by: Loic Dachary --- docs/siteconfig.rst | 3 +++ teuthology/config.py | 1 + teuthology/suite.py | 3 ++- teuthology/worker.py | 8 ++++++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/siteconfig.rst b/docs/siteconfig.rst index 8a54525139..d0ab2643f0 100644 --- a/docs/siteconfig.rst +++ b/docs/siteconfig.rst @@ -57,6 +57,9 @@ Here is a sample configuration with many of the options set and documented:: # Where teuthology and ceph-qa-suite repos should be stored locally src_base_path: /home/foo/src + # Where teuthology path is located: do not clone if present + #teuthology_path: . + # Whether or not teuthology-suite, when scheduling, should update # itself from git. This is disabled by default. automated_scheduling: false diff --git a/teuthology/config.py b/teuthology/config.py index 9bf36f3be6..afb740b5c3 100644 --- a/teuthology/config.py +++ b/teuthology/config.py @@ -144,6 +144,7 @@ class TeuthologyConfig(YamlConfig): 'kojiroot_url': 'http://kojipkgs.fedoraproject.org/packages', 'koji_task_url': 'https://kojipkgs.fedoraproject.org/work/', 'baseurl_template': 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}', + 'teuthology_path': None, } def __init__(self, yaml_path=None): diff --git a/teuthology/suite.py b/teuthology/suite.py index eb784f863b..91454f98c2 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -153,7 +153,8 @@ def fetch_repos(branch, test_name): # teuthology, let's not wreak havoc on it. if config.automated_scheduling: # We use teuthology's master branch in all cases right now - fetch_teuthology('master') + if config.teuthology_path is None: + fetch_teuthology('master') suite_repo_path = fetch_qa_suite(branch) except BranchNotFoundError as exc: schedule_fail(message=str(exc), name=test_name) diff --git a/teuthology/worker.py b/teuthology/worker.py index 0e2bf7c6d7..cc6eb7b1d7 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -79,7 +79,8 @@ def main(ctx): beanstalk.watch_tube(connection, ctx.tube) result_proc = None - fetch_teuthology('master') + if teuth_config.teuthology_path is None: + fetch_teuthology('master') fetch_qa_suite('master') while True: @@ -116,7 +117,10 @@ def main(ctx): job_config['teuthology_branch'] = teuthology_branch try: - teuth_path = fetch_teuthology(branch=teuthology_branch) + if teuth_config.teuthology_path is not None: + teuth_path = teuth_config.teuthology_path + else: + teuth_path = fetch_teuthology(branch=teuthology_branch) # For the teuthology tasks, we look for suite_branch, and if we # don't get that, we look for branch, and fall back to 'master'. # last-in-suite jobs don't have suite_branch or branch set. -- 2.39.5