Merge lp:~abentley/juju-ci-tools/manual-endpoint-xfail into lp:juju-ci-tools

Proposed by Aaron Bentley on 2016-12-14
Status: Merged
Merged at revision: 1812
Proposed branch: lp:~abentley/juju-ci-tools/manual-endpoint-xfail
Merge into: lp:juju-ci-tools
Diff against target: 93 lines (+24/-15)
4 files modified
assess_add_cloud.py (+13/-4)
deploy_stack.py (+2/-2)
tests/test_assess_add_cloud.py (+7/-7)
tests/test_remote.py (+2/-2)
To merge this branch: bzr merge lp:~abentley/juju-ci-tools/manual-endpoint-xfail
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code 2016-12-14 Approve on 2016-12-15
Review via email: mp+313274@code.launchpad.net

Commit Message

Update with expected endpoint failures for manual.

Description of the Change

This branch adds expected failures for manual endpoints due to bug #1649721

In some cases, this means wrapping expected failures inside other expected failures!

Also fixed some lint as a driveby.

To post a comment you must log in.
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 'assess_add_cloud.py'
2--- assess_add_cloud.py 2016-12-13 19:32:27 +0000
3+++ assess_add_cloud.py 2016-12-14 20:18:04 +0000
4@@ -103,14 +103,23 @@
5 yield cloud_spec('bogus-type', 'bogus-type', {'type': 'bogus'},
6 exception=TypeNotAccepted)
7 for cloud_name, cloud in clouds.items():
8- yield cloud_spec(cloud_name, cloud_name, cloud)
9+ spec = cloud_spec(cloud_name, cloud_name, cloud)
10+ if cloud['type'] == 'manual':
11+ spec = xfail(spec, 1649721, InvalidEndpoint)
12+ yield spec
13
14 for cloud_name, cloud in clouds.items():
15- yield xfail(cloud_spec('long-name-{}'.format(cloud_name), 'A' * 4096,
16- cloud, NameNotAccepted), 1641970, NameMismatch)
17- yield xfail(
18+ spec = xfail(cloud_spec('long-name-{}'.format(cloud_name), 'A' * 4096,
19+ cloud, NameNotAccepted), 1641970, NameMismatch)
20+ if cloud['type'] == 'manual':
21+ spec = xfail(spec, 1649721, InvalidEndpoint)
22+ yield spec
23+ spec = xfail(
24 cloud_spec('invalid-name-{}'.format(cloud_name), 'invalid/name',
25 cloud, NameNotAccepted), 1641981, None)
26+ if cloud['type'] == 'manual':
27+ spec = xfail(spec, 1649721, InvalidEndpoint)
28+ yield spec
29
30 if cloud['type'] not in ('maas', 'manual', 'vsphere'):
31 variant = deepcopy(cloud)
32
33=== modified file 'deploy_stack.py'
34--- deploy_stack.py 2016-12-13 16:37:28 +0000
35+++ deploy_stack.py 2016-12-14 20:18:04 +0000
36@@ -1072,8 +1072,8 @@
37 deploy_dummy_stack(client, charm_series, args.use_charmstore)
38 assess_juju_relations(client)
39 skip_juju_run = (
40- (client.version < "2" and sys.platform in ("win32", "darwin"))
41- or charm_series.startswith(("centos", "win")))
42+ (client.version < "2" and sys.platform in ("win32", "darwin")) or
43+ charm_series.startswith(("centos", "win")))
44 if not skip_juju_run:
45 assess_juju_run(client)
46 if args.upgrade:
47
48=== modified file 'tests/test_assess_add_cloud.py'
49--- tests/test_assess_add_cloud.py 2016-12-13 19:32:27 +0000
50+++ tests/test_assess_add_cloud.py 2016-12-14 20:18:04 +0000
51@@ -118,13 +118,13 @@
52 cloud = {'type': 'manual', 'endpoint': 'http://example.com'}
53 spec = cloud_spec('foo', 'foo', cloud)
54 self.assertItemsEqual([
55- self.bogus_type, spec,
56- xfail(cloud_spec('long-name-foo', 'A' * 4096, cloud), 1641970,
57- NameMismatch),
58- xfail(cloud_spec('invalid-name-foo', 'invalid/name', cloud,
59- exception=NameNotAccepted), 1641981, None),
60- make_long_endpoint(spec),
61- ], iter_clouds({'foo': cloud}))
62+ self.bogus_type, xfail(spec, 1649721, InvalidEndpoint),
63+ xfail(xfail(cloud_spec('long-name-foo', 'A' * 4096, cloud),
64+ 1641970, NameMismatch), 1649721, InvalidEndpoint),
65+ xfail(xfail(cloud_spec('invalid-name-foo', 'invalid/name', cloud,
66+ exception=NameNotAccepted), 1641981, None),
67+ 1649721, InvalidEndpoint),
68+ make_long_endpoint(spec)], iter_clouds({'foo': cloud}))
69
70 def test_vsphere(self):
71 cloud = {
72
73=== modified file 'tests/test_remote.py'
74--- tests/test_remote.py 2016-12-13 14:57:04 +0000
75+++ tests/test_remote.py 2016-12-14 20:18:04 +0000
76@@ -151,7 +151,7 @@
77 with patch.object(client, "get_juju_output") as mock_gjo:
78 mock_gjo.side_effect = error
79 with self.assertRaises(subprocess.CalledProcessError) as c:
80- output = remote.run("cat /a/file")
81+ remote.run("cat /a/file")
82 self.assertIs(c.exception, error)
83 mock_gjo.assert_called_once_with("ssh", unit, "cat /a/file",
84 timeout=120)
85@@ -172,7 +172,7 @@
86 with patch("remote._no_platform_ssh", autospec=True,
87 return_value=True) as mock_nps:
88 with self.assertRaises(subprocess.CalledProcessError) as c:
89- output = remote.run("cat /a/file")
90+ remote.run("cat /a/file")
91 self.assertIs(c.exception, error)
92 mock_gjo.assert_called_once_with("ssh", unit, "cat /a/file",
93 timeout=120)

Subscribers

People subscribed via source and target branches