From 506ce9375adbc914b5d01f37bcb2feb8eb97f8b3 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 11 Jul 2016 12:25:07 -0700 Subject: [PATCH] Resume paying attention to --email Change in 61350db caused email arg to be lost. Fix, add test Signed-off-by: Dan Mick --- teuthology/suite/run.py | 4 ++-- teuthology/suite/test/test_run_.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 1b3529961a..83333ee68c 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -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 diff --git a/teuthology/suite/test/test_run_.py b/teuthology/suite/test/test_run_.py index 7bd99b567c..5fbe2096f5 100644 --- a/teuthology/suite/test/test_run_.py +++ b/teuthology/suite/test/test_run_.py @@ -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') -- 2.39.5