]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: pass the commit of teuthology with each job's config
authorJosh Durgin <jdurgin@redhat.com>
Sun, 17 Jan 2021 02:16:59 +0000 (21:16 -0500)
committerJosh Durgin <jdurgin@redhat.com>
Tue, 19 Jan 2021 06:43:15 +0000 (01:43 -0500)
We already pass the suite sha1, but do not use it yet. This is the
missing piece to be able to use the same version of everything across
a whole run.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
teuthology/suite/placeholder.py
teuthology/suite/run.py
teuthology/suite/test/test_placeholder.py

index 1e5014d0ae193ae906a94a0b1102830be3c1a805..2bfd07df8596efa3e1550a85a92cd67ace44f53d 100644 (file)
@@ -47,6 +47,7 @@ dict_templ = {
     'branch': Placeholder('ceph_branch'),
     'sha1': Placeholder('ceph_hash'),
     'teuthology_branch': Placeholder('teuthology_branch'),
+    'teuthology_sha1': Placeholder('teuthology_sha1'),
     'archive_upload': Placeholder('archive_upload'),
     'archive_upload_key': Placeholder('archive_upload_key'),
     'machine_type': Placeholder('machine_type'),
index 3b64185ee9b3c29150a50932990446daac6371c1..4b43d0180ad923ac960bb946dd8ccc51b7f89e09 100644 (file)
@@ -99,7 +99,7 @@ class Run(object):
         else:
             self.suite_repo_path = util.fetch_repos(
                 suite_branch, test_name=self.name)
-        teuthology_branch = self.choose_teuthology_branch()
+        teuthology_branch, teuthology_sha1 = self.choose_teuthology_branch()
 
 
         if self.args.distro_version:
@@ -113,6 +113,7 @@ class Run(object):
             ceph_hash=ceph_hash,
             ceph_repo=config.get_ceph_git_url(),
             teuthology_branch=teuthology_branch,
+            teuthology_sha1=teuthology_sha1,
             machine_type=self.args.machine_type,
             distro=self.args.distro,
             distro_version=self.args.distro_version,
@@ -200,8 +201,9 @@ class Run(object):
             log.info('skipping ceph package verification')
 
     def choose_teuthology_branch(self):
-        """Select teuthology branch, check if it is present in repo and
-        return the branch name value.
+        """Select teuthology branch, check if it is present in repo and return
+        tuple (branch, hash) where hash is commit sha1 corresponding
+        to the HEAD of the branch.
 
         The branch name value is determined in the following order:
 
@@ -220,6 +222,7 @@ class Run(object):
         Use ``master``.
 
         Generate exception if the branch is not present in the repo.
+
         """
         teuthology_branch = self.args.teuthology_branch
         if not teuthology_branch:
@@ -242,15 +245,15 @@ class Run(object):
         if not teuthology_branch:
             teuthology_branch = config.get('teuthology_branch', 'master')
 
-        teuthology_hash = util.git_ls_remote(
+        teuthology_sha1 = util.git_ls_remote(
             'teuthology',
             teuthology_branch
         )
-        if not teuthology_hash:
+        if not teuthology_sha1:
             exc = BranchNotFoundError(teuthology_branch, build_git_url('teuthology'))
             util.schedule_fail(message=str(exc), name=self.name)
-        log.info("teuthology branch: %s %s", teuthology_branch, teuthology_hash)
-        return teuthology_branch
+        log.info("teuthology branch: %s %s", teuthology_branch, teuthology_sha1)
+        return teuthology_branch, teuthology_sha1
 
     @property
     def ceph_repo_name(self):
index 4b2c2fb75acecf9f8cad0c932631a528645573a8..3427439fd309de0dabff6ebe1d00d7f835bf2c45 100644 (file)
@@ -13,6 +13,7 @@ class TestPlaceholder(object):
             ceph_branch='ceph_branch',
             ceph_hash='ceph_hash',
             teuthology_branch='teuthology_branch',
+            teuthology_sha1='teuthology_sha1',
             machine_type='machine_type',
             distro='distro',
             distro_version='distro_version',
@@ -38,6 +39,7 @@ class TestPlaceholder(object):
             ceph_branch='ceph_branch',
             ceph_hash='ceph_hash',
             teuthology_branch='teuthology_branch',
+            teuthology_sha1='teuthology_sha1',
             machine_type='machine_type',
             archive_upload='archive_upload',
             archive_upload_key='archive_upload_key',