Merge lp:~abentley/charms/trusty/juju-reports/test-failure-email into lp:~juju-qa/charms/trusty/juju-reports/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 80
Proposed branch: lp:~abentley/charms/trusty/juju-reports/test-failure-email
Merge into: lp:~juju-qa/charms/trusty/juju-reports/trunk
Diff against target: 67 lines (+11/-3)
3 files modified
config.yaml (+4/-0)
hooks/common.py (+4/-2)
tests/test_common.py (+3/-1)
To merge this branch: bzr merge lp:~abentley/charms/trusty/juju-reports/test-failure-email
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+314241@code.launchpad.net

Commit message

Add test-failure-email support to charm.

Description of the change

This branch adds support for a test-failure-email config value.

In a separate series of branches, I add support for sending test failure emails from juju-reports.

Juju reports already sends emails on error. The audience for error emails is the maintainers of reports.vapour.ws, i.e. the juju-qa team. The audience for test failures is the developers of juju as well as the maintainers of the CI infrastracture, i.e. the canonical-juju list.

Since there are two different audiences, they need two different addresses, and this branch adds support for the new address to the charm.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-07-28 21:30:25 +0000
3+++ config.yaml 2017-01-06 19:12:50 +0000
4@@ -13,6 +13,10 @@
5 type: int
6 default: -1
7 description: "The revno of the bzr branch to use. -1 for current tip."
8+ test-failure-email:
9+ type: string
10+ default: ""
11+ description: "Address to mail test failures to."
12 error-email:
13 type: string
14 default: ""
15
16=== modified file 'hooks/common.py'
17--- hooks/common.py 2016-07-29 16:37:35 +0000
18+++ hooks/common.py 2017-01-06 19:12:50 +0000
19@@ -52,7 +52,7 @@
20 def install_ini(mongo_url, gh_token, cidata_url, token,
21 error_email, error_email_from, cloud_health_failure_threshold,
22 current_conditions_list, jujuci_url, jujuci_username,
23- jujuci_password, source_path):
24+ jujuci_password, source_path, test_failure_email):
25 with update_ini(source_path, INI) as config:
26 config.set('app:main', 'mongo.url', mongo_url)
27 config.set('app:main', 'gh_token', gh_token)
28@@ -64,6 +64,7 @@
29 config.set('app:main', 'home', HOME)
30 config.set('app:main', 'error_email', error_email)
31 config.set('app:main', 'error_email_from', error_email_from)
32+ config.set('app:main', 'test_failure_email', test_failure_email)
33 config.set(
34 'app:main', 'cloud_health_failure_threshold',
35 cloud_health_failure_threshold)
36@@ -449,7 +450,8 @@
37 config['cloud-health-failure-threshold'],
38 config['current-conditions-list'],
39 config['jujuci-url'], config['jujuci-user'],
40- config['jujuci-pass'], source_path)
41+ config['jujuci-pass'], source_path,
42+ config['test-failure-email'])
43 unset = [key for key in [
44 'lp-key', 'lp-oauth', 'gh-token', 'charm-bundle-test-token',
45 'error-email', 'error-email-from'
46
47=== modified file 'tests/test_common.py'
48--- tests/test_common.py 2015-09-25 19:01:03 +0000
49+++ tests/test_common.py 2017-01-06 19:12:50 +0000
50@@ -77,7 +77,7 @@
51 'error_email', 'error_email_from',
52 'cloud_health_failure_threshold', 'current_conditions_list',
53 'jujuci_url', 'jujuci_username', 'jujuci_password',
54- 'source_path')
55+ 'source_path', 'test_failure_email')
56 self.assertEqual(2, mock.call_count)
57 mock.assert_any_call('source_path', INI)
58 mock.assert_any_call('source_path', 'test.ini')
59@@ -93,6 +93,8 @@
60 self.assertEqual(
61 'token', ini.get('app:main', 'charm_bundle_test_token'))
62 self.assertEqual(HOME, ini.get('app:main', 'HOME'))
63+ self.assertEqual('test_failure_email',
64+ ini.get('app:main', 'test_failure_email'))
65 self.assertEqual('error_email', ini.get('app:main', 'error_email'))
66 self.assertEqual(
67 'error_email_from', ini.get('app:main', 'error_email_from'))

Subscribers

People subscribed via source and target branches