From: Nathan Cutler Date: Wed, 1 Aug 2018 16:26:55 +0000 (+0200) Subject: suite: disregard trailing slash and expand unit tests X-Git-Tag: 1.1.0~309^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ed0c20edf492ab40c303f86dc507e4786bdb4cde;p=teuthology.git suite: disregard trailing slash and expand unit tests Signed-off-by: Nathan Cutler --- diff --git a/teuthology/suite/__init__.py b/teuthology/suite/__init__.py index 57a689538d..bc171ab338 100644 --- a/teuthology/suite/__init__.py +++ b/teuthology/suite/__init__.py @@ -72,9 +72,13 @@ def expand_short_repo_name(name, orig): # when the orig URL is also github. The two-level substitution may not # work with some configs. name_vec = name.split('/') + if name_vec[-1] == '': + del name_vec[-1] if len(name_vec) <= 2 and name.count(':') == 0: orig_vec = orig.split('/') - return '/'.join(orig_vec[:-len(name_vec)] + name_vec) + if orig_vec[-1] == '': + del orig_vec[-1] + return '/'.join(orig_vec[:-len(name_vec)] + name_vec) + '.git' # otherwise, assume a full URL return name diff --git a/teuthology/suite/test/test_init.py b/teuthology/suite/test/test_init.py index 8a8622e54e..dcb1b94fe7 100644 --- a/teuthology/suite/test/test_init.py +++ b/teuthology/suite/test/test_init.py @@ -105,21 +105,33 @@ def test_wait_fails(m_get_jobs): REPO_SHORTHAND = [ ['https://github.com/dude/foo', 'bar', - 'https://github.com/dude/bar'], + 'https://github.com/dude/bar.git'], ['https://github.com/dude/foo/', 'bar', - 'https://github.com/dude/foo/bar'], + 'https://github.com/dude/bar.git'], ['https://github.com/ceph/ceph', 'ceph', - 'https://github.com/ceph/ceph'], + 'https://github.com/ceph/ceph.git'], + ['https://github.com/ceph/ceph/', 'ceph', + 'https://github.com/ceph/ceph.git'], + ['https://github.com/ceph/ceph.git', 'ceph', + 'https://github.com/ceph/ceph.git'], ['https://github.com/ceph/ceph', 'ceph-ci', - 'https://github.com/ceph/ceph-ci'], + 'https://github.com/ceph/ceph-ci.git'], ['https://github.com/ceph/ceph-ci', 'ceph', - 'https://github.com/ceph/ceph'], + 'https://github.com/ceph/ceph.git'], ['git://git.ceph.com/ceph.git', 'ceph', - 'git://git.ceph.com/ceph'], + 'git://git.ceph.com/ceph.git'], ['git://git.ceph.com/ceph.git', 'ceph-ci', - 'git://git.ceph.com/ceph-ci'], + 'git://git.ceph.com/ceph-ci.git'], ['git://git.ceph.com/ceph-ci.git', 'ceph', - 'git://git.ceph.com/ceph'], + 'git://git.ceph.com/ceph.git'], + ['https://github.com/ceph/ceph.git', 'ceph/ceph-ci', + 'https://github.com/ceph/ceph-ci.git'], + ['https://github.com/ceph/ceph.git', 'https://github.com/ceph/ceph-ci', + 'https://github.com/ceph/ceph-ci'], + ['https://github.com/ceph/ceph.git', 'https://github.com/ceph/ceph-ci/', + 'https://github.com/ceph/ceph-ci/'], + ['https://github.com/ceph/ceph.git', 'https://github.com/ceph/ceph-ci.git', + 'https://github.com/ceph/ceph-ci.git'], ]