Skip to content

Commit

Permalink
qa/tasks/workunit: use ceph.git as an alternative of ceph-ci.git for …
Browse files Browse the repository at this point in the history
…workunit repo

if we run upgrade test, where, for example, "jewel" is not in
ceph-ci.git repo, we should check ceph.git to clone the workunits.

Signed-off-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Feb 27, 2017
1 parent da06227 commit 6a201c7
Showing 1 changed file with 46 additions and 16 deletions.
62 changes: 46 additions & 16 deletions qa/tasks/workunit.py
Expand Up @@ -309,23 +309,53 @@ def _run_tests(ctx, refspec, role, tests, env, subdir=None, timeout=None):
srcdir = '{cdir}/qa/workunits'.format(cdir=clonedir)

git_url = teuth_config.get_ceph_qa_suite_git_url()
remote.run(
logger=log.getChild(role),
args=[
'rm',
'-rf',
clonedir,
run.Raw('&&'),
'git',
'clone',
# if we are running an upgrade test, and ceph-ci does not have branches like
# `jewel`, so should use ceph.git as an alternative.
try:
remote.run(
logger=log.getChild(role),
args=[
'rm',
'-rf',
clonedir,
run.Raw('&&'),
'git',
'clone',
git_url,
clonedir,
run.Raw('&&'),
'cd', '--', clonedir,
run.Raw('&&'),
'git', 'checkout', refspec,
],
)
except CommandFailedError:
if not git_url.endswith('/ceph-ci.git'):
raise
alt_git_url = git_url.replace('/ceph-ci.git', '/ceph.git')
log.info(
"failed to check out '%s' from %s; will also try in %s",
refspec,
git_url,
clonedir,
run.Raw('&&'),
'cd', '--', clonedir,
run.Raw('&&'),
'git', 'checkout', refspec,
],
)
alt_git_url,
)
remote.run(
logger=log.getChild(role),
args=[
'rm',
'-rf',
clonedir,
run.Raw('&&'),
'git',
'clone',
git_url,
clonedir,
run.Raw('&&'),
'cd', '--', clonedir,
run.Raw('&&'),
'git', 'checkout', refspec,
],
)
remote.run(
logger=log.getChild(role),
args=[
Expand Down

0 comments on commit 6a201c7

Please sign in to comment.