]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: disregard trailing slash and expand unit tests 1002/head
authorNathan Cutler <ncutler@suse.com>
Wed, 1 Aug 2018 16:26:55 +0000 (18:26 +0200)
committerNathan Cutler <ncutler@suse.com>
Wed, 1 Aug 2018 16:26:55 +0000 (18:26 +0200)
Signed-off-by: Nathan Cutler <ncutler@suse.com>
teuthology/suite/__init__.py
teuthology/suite/test/test_init.py

index 57a689538da2ae25d78dac025f1a7cad421b7056..bc171ab33895ab0cdf51c5df3d5ef38b729d0fce 100644 (file)
@@ -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
 
index 8a8622e54e3a1f0df0881ad158ce25410049e3f4..dcb1b94fe73c5e4af199bc5f83380313381a99eb 100644 (file)
@@ -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'],
 ]