]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Resume paying attention to --email 906/head
authorDan Mick <dan.mick@redhat.com>
Mon, 11 Jul 2016 19:25:07 +0000 (12:25 -0700)
committerDan Mick <dan.mick@redhat.com>
Mon, 11 Jul 2016 19:25:07 +0000 (12:25 -0700)
Change in 61350db caused email arg to be lost.  Fix, add test

Signed-off-by: Dan Mick <dan.mick@redhat.com>
teuthology/suite/run.py
teuthology/suite/test/test_run_.py

index 1b3529961a215bbe13140f8d109c1e5d6ec7ee8d..83333ee68c36eb57db9bf7cdea0ead30437a9785 100644 (file)
@@ -215,8 +215,8 @@ class Run(object):
         job_config = JobConfig.from_dict(conf_dict)
         job_config.name = self.name
         job_config.priority = self.args.priority
-        if self.args.results_email:
-            job_config.email = self.args.results_email
+        if self.args.email:
+            job_config.email = self.args.email
         if self.args.owner:
             job_config.owner = self.args.owner
         return job_config
index 7bd99b567c8c98b86772a67e558e14e09471d251..5fbe2096f52b31fa65a54d875d5c32c9ca51d16e 100644 (file)
@@ -18,6 +18,7 @@ class TestRun(object):
             suite_branch='suite_branch',
             ceph_branch='ceph_branch',
             ceph_sha1='ceph_sha1',
+            email='address@example.com',
             teuthology_branch='teuthology_branch',
             kernel_branch=None,
             kernel_flavor='kernel_flavor',
@@ -27,6 +28,20 @@ class TestRun(object):
         )
         self.args = YamlConfig.from_dict(self.args_dict)
 
+    @patch('teuthology.suite.run.util.git_ls_remote')
+    @patch('teuthology.suite.run.Run.choose_ceph_version')
+    @patch('teuthology.suite.run.util.git_validate_sha1')
+    def test_email_addr(self, m_git_validate_sha1, m_choose_ceph_version, m_git_ls_remote):
+        # neuter choose_X_branch
+        m_git_validate_sha1.return_value = self.args_dict['ceph_sha1']
+        m_choose_ceph_version.return_value = self.args_dict['ceph_sha1']
+        self.args_dict['teuthology_branch'] = 'master'
+        self.args_dict['suite_branch'] = 'master'
+        m_git_ls_remote.return_value = 'suite_sha1'
+
+        runobj = self.klass(self.args)
+        assert runobj.base_config.email == self.args_dict['email']
+
     @patch('teuthology.suite.run.util.fetch_repos')
     def test_name(self, m_fetch_repos):
         stamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')