:returns: The destination path
"""
src_base_path = config.src_base_path
+ if not os.path.exists(src_base_path):
+ os.mkdir(src_base_path)
dest_path = os.path.join(src_base_path, 'ceph-qa-suite_' + branch)
qa_suite_url = os.path.join(config.ceph_git_base_url, 'ceph-qa-suite')
# only let one worker create/update the checkout at a time
return dest_path
-def fetch_teuthology_branch(branch, lock=True):
+def fetch_teuthology(branch, lock=True):
"""
Make sure we have the correct teuthology branch checked out and up-to-date
- :param branch: The branche we want
+ :param branch: The branch we want
:returns: The destination path
"""
src_base_path = config.src_base_path
+ if not os.path.exists(src_base_path):
+ os.mkdir(src_base_path)
dest_path = os.path.join(src_base_path, 'teuthology_' + branch)
# only let one worker create/update the checkout at a time
lock_path = dest_path.rstrip('/') + '.lock'
import teuthology
from . import lock
from .config import config, JobConfig
-from .repo_utils import enforce_repo_state
from .exceptions import BranchNotFoundError
+from .repo_utils import fetch_qa_suite, fetch_teuthology
log = logging.getLogger(__name__)
if suite_dir:
suite_repo_path = suite_dir
else:
- suite_repo_path = fetch_suite_repo(job_config.suite_branch,
- test_name=name)
+ suite_repo_path = fetch_repos(job_config.suite_branch, test_name=name)
job_config.name = name
job_config.priority = priority
)
-def fetch_suite_repo(branch, test_name):
+def fetch_repos(branch, test_name):
"""
Fetch the suite repo (and also the teuthology repo) so that we can use it
to build jobs. Repos are stored in ~/src/.
for test scheduling, regardless of what teuthology branch is requested for
testing.
- :returns: The path to the repo on disk
+ :returns: The path to the suite repo on disk
"""
- src_base_path = config.src_base_path
- if not os.path.exists(src_base_path):
- os.mkdir(src_base_path)
- suite_repo_path = os.path.join(src_base_path,
- 'ceph-qa-suite_' + branch)
try:
# When a user is scheduling a test run from their own copy of
# teuthology, let's not wreak havoc on it.
if config.automated_scheduling:
- enforce_repo_state(
- repo_url=os.path.join(config.ceph_git_base_url,
- 'teuthology.git'),
- dest_path=os.path.join(src_base_path, 'teuthology'),
- branch='master',
- remove_on_error=False,
- )
- enforce_repo_state(
- repo_url=os.path.join(config.ceph_git_base_url,
- 'ceph-qa-suite.git'),
- dest_path=suite_repo_path,
- branch=branch,
- )
+ # We use teuthology's master branch in all cases right now
+ fetch_teuthology('master')
+ suite_repo_path = fetch_qa_suite(branch)
except BranchNotFoundError as exc:
schedule_fail(message=str(exc), name=test_name)
return suite_repo_path
from .exceptions import BranchNotFoundError
from .kill import kill_job
from .misc import read_config
-from .repo_utils import fetch_qa_suite, fetch_teuthology_branch
+from .repo_utils import fetch_qa_suite, fetch_teuthology
log = logging.getLogger(__name__)
start_time = datetime.utcnow()
job_config['teuthology_branch'] = teuthology_branch
try:
- teuth_path = fetch_teuthology_branch(branch=teuthology_branch)
+ 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.