Merge ~hloeung/jenkins-agent-charm:cleanup into jenkins-agent-charm:master
- Git
- lp:~hloeung/jenkins-agent-charm
- cleanup
- Merge into master
Proposed by
Haw Loeung
Status: | Merged |
---|---|
Approved by: | Haw Loeung |
Approved revision: | b6ad34249106d0e47d23a08e1571378a44ffd973 |
Merged at revision: | 63a4a4bf7be28b85f2d972b06339c498cc703082 |
Proposed branch: | ~hloeung/jenkins-agent-charm:cleanup |
Merge into: | jenkins-agent-charm:master |
Prerequisite: | ~hloeung/jenkins-agent-charm:master |
Diff against target: |
276 lines (+77/-53) 4 files modified
Makefile (+4/-0) reactive/jenkins_slave.py (+11/-13) tests/unit/test_jenkins_slave.py (+58/-40) tox.ini (+4/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stuart Bishop (community) | Approve | ||
Canonical IS Reviewers | Pending | ||
Review via email: mp+371238@code.launchpad.net |
Commit message
Add and normalise python layout with black
Description of the change
To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote : | # |
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote : | # |
Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote : | # |
Change successfully merged at revision 63a4a4bf7be28b8
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/Makefile b/Makefile | |||
2 | index 43470ed..c0b3852 100644 | |||
3 | --- a/Makefile | |||
4 | +++ b/Makefile | |||
5 | @@ -10,6 +10,8 @@ help: | |||
6 | 10 | @echo "" | 10 | @echo "" |
7 | 11 | 11 | ||
8 | 12 | lint: | 12 | lint: |
9 | 13 | @echo "Normalising python layout with black." | ||
10 | 14 | @tox -e black | ||
11 | 13 | @echo "Running flake8" | 15 | @echo "Running flake8" |
12 | 14 | @tox -e lint | 16 | @tox -e lint |
13 | 15 | 17 | ||
14 | @@ -25,6 +27,8 @@ clean: | |||
15 | 25 | @echo "Cleaning files" | 27 | @echo "Cleaning files" |
16 | 26 | @rm -rf ./.tox | 28 | @rm -rf ./.tox |
17 | 27 | @rm -rf ./.pytest_cache | 29 | @rm -rf ./.pytest_cache |
18 | 30 | @rm -rf ./tests/unit/__pycache__ ./reactive/__pycache__ ./lib/__pycache__ | ||
19 | 31 | @rm -rf ./.coverage ./.unit-state.db | ||
20 | 28 | 32 | ||
21 | 29 | # The targets below don't depend on a file | 33 | # The targets below don't depend on a file |
22 | 30 | .PHONY: lint test unittest functionaltest clean help | 34 | .PHONY: lint test unittest functionaltest clean help |
23 | diff --git a/reactive/jenkins_slave.py b/reactive/jenkins_slave.py | |||
24 | index 29bf58f..9c2089b 100755 | |||
25 | --- a/reactive/jenkins_slave.py | |||
26 | +++ b/reactive/jenkins_slave.py | |||
27 | @@ -215,20 +215,18 @@ def file_to_units(local_path, unit_path, perms=None, owner='root', group='root') | |||
28 | 215 | file_perms = 0o644 | 215 | file_perms = 0o644 |
29 | 216 | 216 | ||
30 | 217 | with open(local_path, 'r') as fh: | 217 | with open(local_path, 'r') as fh: |
38 | 218 | host.write_file( | 218 | host.write_file(path=unit_path, content=fh.read().encode(), owner=owner, group=group, perms=file_perms) |
32 | 219 | path=unit_path, | ||
33 | 220 | content=fh.read().encode(), | ||
34 | 221 | owner=owner, | ||
35 | 222 | group=group, | ||
36 | 223 | perms=file_perms, | ||
37 | 224 | ) | ||
39 | 225 | 219 | ||
40 | 226 | 220 | ||
43 | 227 | def write_default_conf(master_url=None, owner='root', group='root', | 221 | def write_default_conf(master_url=None, owner='root', group='root', conf_path='/etc/default/jenkins-slave'): |
42 | 228 | conf_path='/etc/default/jenkins-slave'): | ||
44 | 229 | templates_dir = os.path.join(hookenv.charm_dir(), 'templates') | 222 | templates_dir = os.path.join(hookenv.charm_dir(), 'templates') |
45 | 230 | slave_host = hookenv.local_unit().replace('/', '-') | 223 | slave_host = hookenv.local_unit().replace('/', '-') |
50 | 231 | templating.render('jenkins-slave-default', conf_path, | 224 | templating.render( |
51 | 232 | {'master_url': master_url, 'slave_host': slave_host}, | 225 | 'jenkins-slave-default', |
52 | 233 | owner=owner, group=group, perms=0o444, | 226 | conf_path, |
53 | 234 | templates_dir=templates_dir) | 227 | {'master_url': master_url, 'slave_host': slave_host}, |
54 | 228 | owner=owner, | ||
55 | 229 | group=group, | ||
56 | 230 | perms=0o444, | ||
57 | 231 | templates_dir=templates_dir, | ||
58 | 232 | ) | ||
59 | diff --git a/tests/unit/test_jenkins_slave.py b/tests/unit/test_jenkins_slave.py | |||
60 | index 535bc95..b33f1ed 100644 | |||
61 | --- a/tests/unit/test_jenkins_slave.py | |||
62 | +++ b/tests/unit/test_jenkins_slave.py | |||
63 | @@ -71,8 +71,13 @@ class TestSetDefaultConf(unittest.TestCase): | |||
64 | 71 | patcher = mock.patch('os.uname') | 71 | patcher = mock.patch('os.uname') |
65 | 72 | self.mock_log = patcher.start() | 72 | self.mock_log = patcher.start() |
66 | 73 | self.addCleanup(patcher.stop) | 73 | self.addCleanup(patcher.stop) |
69 | 74 | self.mock_log.return_value = ('Linux', 'mock-jenkins-slave', '4.15.0-46-generic', | 74 | self.mock_log.return_value = ( |
70 | 75 | '#49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019', 'x86_64') | 75 | 'Linux', |
71 | 76 | 'mock-jenkins-slave', | ||
72 | 77 | '4.15.0-46-generic', | ||
73 | 78 | '#49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019', | ||
74 | 79 | 'x86_64', | ||
75 | 80 | ) | ||
76 | 76 | 81 | ||
77 | 77 | patcher = mock.patch('os.cpu_count') | 82 | patcher = mock.patch('os.cpu_count') |
78 | 78 | self.mock_log = patcher.start() | 83 | self.mock_log = patcher.start() |
79 | @@ -89,9 +94,11 @@ class TestSetDefaultConf(unittest.TestCase): | |||
80 | 89 | '''Test correct flags set via upgrade-charm hook''' | 94 | '''Test correct flags set via upgrade-charm hook''' |
81 | 90 | jenkins_slave.upgrade_charm() | 95 | jenkins_slave.upgrade_charm() |
82 | 91 | self.assertFalse(status.maintenance.assert_called()) | 96 | self.assertFalse(status.maintenance.assert_called()) |
86 | 92 | expected = [mock.call('jenkins-slave.active'), | 97 | expected = [ |
87 | 93 | mock.call('jenkins-slave.installed'), | 98 | mock.call('jenkins-slave.active'), |
88 | 94 | mock.call('nagios-nrpe.configured')] | 99 | mock.call('jenkins-slave.installed'), |
89 | 100 | mock.call('nagios-nrpe.configured'), | ||
90 | 101 | ] | ||
91 | 95 | self.assertFalse(clear_flag.assert_has_calls(expected, any_order=True)) | 102 | self.assertFalse(clear_flag.assert_has_calls(expected, any_order=True)) |
92 | 96 | 103 | ||
93 | 97 | @mock.patch('charms.reactive.clear_flag') | 104 | @mock.patch('charms.reactive.clear_flag') |
94 | @@ -99,8 +106,7 @@ class TestSetDefaultConf(unittest.TestCase): | |||
95 | 99 | '''Test correct flags are set via config-changed charm hook''' | 106 | '''Test correct flags are set via config-changed charm hook''' |
96 | 100 | jenkins_slave.config_changed() | 107 | jenkins_slave.config_changed() |
97 | 101 | self.assertFalse(status.maintenance.assert_called()) | 108 | self.assertFalse(status.maintenance.assert_called()) |
100 | 102 | expected = [mock.call('jenkins-slave.configured'), | 109 | expected = [mock.call('jenkins-slave.configured'), mock.call('nagios-nrpe.configured')] |
99 | 103 | mock.call('nagios-nrpe.configured')] | ||
101 | 104 | self.assertFalse(clear_flag.assert_has_calls(expected, any_order=True)) | 110 | self.assertFalse(clear_flag.assert_has_calls(expected, any_order=True)) |
102 | 105 | 111 | ||
103 | 106 | @mock.patch('charmhelpers.core.hookenv.config') | 112 | @mock.patch('charmhelpers.core.hookenv.config') |
104 | @@ -112,8 +118,8 @@ class TestSetDefaultConf(unittest.TestCase): | |||
105 | 112 | @mock.patch('reactive.jenkins_slave.file_to_units') | 118 | @mock.patch('reactive.jenkins_slave.file_to_units') |
106 | 113 | @mock.patch('reactive.jenkins_slave.write_default_conf') | 119 | @mock.patch('reactive.jenkins_slave.write_default_conf') |
107 | 114 | def test_hook_install( | 120 | def test_hook_install( |
110 | 115 | self, write_default_conf, file_to_units, apt_purge, user_exists, service, | 121 | self, write_default_conf, file_to_units, apt_purge, user_exists, service, mkdir, adduser, config |
111 | 116 | mkdir, adduser, config): | 122 | ): |
112 | 117 | config.return_value = {'tools': 'some-tools-package'} | 123 | config.return_value = {'tools': 'some-tools-package'} |
113 | 118 | apt.install_queued.return_value = True | 124 | apt.install_queued.return_value = True |
114 | 119 | user_exists.return_value = False | 125 | user_exists.return_value = False |
115 | @@ -122,18 +128,24 @@ class TestSetDefaultConf(unittest.TestCase): | |||
116 | 122 | 128 | ||
117 | 123 | expected = [mock.call(home_dir='/var/lib/jenkins', system_user=True, username='jenkins')] | 129 | expected = [mock.call(home_dir='/var/lib/jenkins', system_user=True, username='jenkins')] |
118 | 124 | self.assertFalse(adduser.assert_has_calls(expected, any_order=True)) | 130 | self.assertFalse(adduser.assert_has_calls(expected, any_order=True)) |
121 | 125 | expected = [mock.call('/var/lib/jenkins', group='jenkins', owner='jenkins'), | 131 | expected = [ |
122 | 126 | mock.call('/var/log/jenkins', group='jenkins', owner='jenkins')] | 132 | mock.call('/var/lib/jenkins', group='jenkins', owner='jenkins'), |
123 | 133 | mock.call('/var/log/jenkins', group='jenkins', owner='jenkins'), | ||
124 | 134 | ] | ||
125 | 127 | self.assertFalse(mkdir.assert_has_calls(expected, any_order=True)) | 135 | self.assertFalse(mkdir.assert_has_calls(expected, any_order=True)) |
126 | 128 | self.assertFalse(service.assert_has_calls([mock.call('enable', 'jenkins-slave')], any_order=True)) | 136 | self.assertFalse(service.assert_has_calls([mock.call('enable', 'jenkins-slave')], any_order=True)) |
127 | 129 | self.assertFalse(apt_purge.assert_has_calls([mock.call(['jenkins-slave'])], any_order=True)) | 137 | self.assertFalse(apt_purge.assert_has_calls([mock.call(['jenkins-slave'])], any_order=True)) |
131 | 130 | expected = [mock.call('files/download-slave.sh', '/usr/local/sbin/download-slave.sh'), | 138 | expected = [ |
132 | 131 | mock.call('files/jenkins-slave-logrotate-config', '/etc/logrotate.d/jenkins-slave'), | 139 | mock.call('files/download-slave.sh', '/usr/local/sbin/download-slave.sh'), |
133 | 132 | mock.call('files/jenkins-slave-systemd-config', '/lib/systemd/system/jenkins-slave.service')] | 140 | mock.call('files/jenkins-slave-logrotate-config', '/etc/logrotate.d/jenkins-slave'), |
134 | 141 | mock.call('files/jenkins-slave-systemd-config', '/lib/systemd/system/jenkins-slave.service'), | ||
135 | 142 | ] | ||
136 | 133 | self.assertFalse(file_to_units.assert_has_calls(expected, any_order=True)) | 143 | self.assertFalse(file_to_units.assert_has_calls(expected, any_order=True)) |
137 | 134 | self.assertFalse(write_default_conf.assert_called()) | 144 | self.assertFalse(write_default_conf.assert_called()) |
140 | 135 | expected = [mock.call.queue_install(['wget', 'default-jre-headless', 'some-tools-package']), | 145 | expected = [ |
141 | 136 | mock.call.install_queued()] | 146 | mock.call.queue_install(['wget', 'default-jre-headless', 'some-tools-package']), |
142 | 147 | mock.call.install_queued(), | ||
143 | 148 | ] | ||
144 | 137 | self.assertEqual(apt.method_calls, expected) | 149 | self.assertEqual(apt.method_calls, expected) |
145 | 138 | 150 | ||
146 | 139 | apt.install_queued.return_value = False | 151 | apt.install_queued.return_value = False |
147 | @@ -168,8 +180,9 @@ class TestSetDefaultConf(unittest.TestCase): | |||
148 | 168 | @mock.patch('charmhelpers.core.unitdata.kv') | 180 | @mock.patch('charmhelpers.core.unitdata.kv') |
149 | 169 | @mock.patch('reactive.jenkins_slave.write_default_conf') | 181 | @mock.patch('reactive.jenkins_slave.write_default_conf') |
150 | 170 | @mock.patch('reactive.jenkins_slave.file_to_units') | 182 | @mock.patch('reactive.jenkins_slave.file_to_units') |
153 | 171 | def test_configure_jenkins_slave_no_url(self, file_to_units, write_default_conf, unitdata_kv, config, | 183 | def test_configure_jenkins_slave_no_url( |
154 | 172 | set_flag, clear_flag): | 184 | self, file_to_units, write_default_conf, unitdata_kv, config, set_flag, clear_flag |
155 | 185 | ): | ||
156 | 173 | config.return_value = {} | 186 | config.return_value = {} |
157 | 174 | unitdata_kv.return_value = {} | 187 | unitdata_kv.return_value = {} |
158 | 175 | jenkins_slave.configure_jenkins_slave() | 188 | jenkins_slave.configure_jenkins_slave() |
159 | @@ -183,8 +196,9 @@ class TestSetDefaultConf(unittest.TestCase): | |||
160 | 183 | @mock.patch('charmhelpers.core.unitdata.kv') | 196 | @mock.patch('charmhelpers.core.unitdata.kv') |
161 | 184 | @mock.patch('reactive.jenkins_slave.write_default_conf') | 197 | @mock.patch('reactive.jenkins_slave.write_default_conf') |
162 | 185 | @mock.patch('reactive.jenkins_slave.file_to_units') | 198 | @mock.patch('reactive.jenkins_slave.file_to_units') |
165 | 186 | def test_configure_jenkins_slave_master_url(self, file_to_units, write_default_conf, unitdata_kv, config, | 199 | def test_configure_jenkins_slave_master_url( |
166 | 187 | set_flag, clear_flag): | 200 | self, file_to_units, write_default_conf, unitdata_kv, config, set_flag, clear_flag |
167 | 201 | ): | ||
168 | 188 | config.return_value = {'master_url': 'http://10.1.1.1:8080'} | 202 | config.return_value = {'master_url': 'http://10.1.1.1:8080'} |
169 | 189 | unitdata_kv.return_value = {} | 203 | unitdata_kv.return_value = {} |
170 | 190 | jenkins_slave.configure_jenkins_slave() | 204 | jenkins_slave.configure_jenkins_slave() |
171 | @@ -199,8 +213,9 @@ class TestSetDefaultConf(unittest.TestCase): | |||
172 | 199 | @mock.patch('charmhelpers.core.unitdata.kv') | 213 | @mock.patch('charmhelpers.core.unitdata.kv') |
173 | 200 | @mock.patch('reactive.jenkins_slave.write_default_conf') | 214 | @mock.patch('reactive.jenkins_slave.write_default_conf') |
174 | 201 | @mock.patch('reactive.jenkins_slave.file_to_units') | 215 | @mock.patch('reactive.jenkins_slave.file_to_units') |
177 | 202 | def test_configure_jenkins_slave_relation_url(self, file_to_units, write_default_conf, unitdata_kv, config, | 216 | def test_configure_jenkins_slave_relation_url( |
178 | 203 | set_flag, clear_flag): | 217 | self, file_to_units, write_default_conf, unitdata_kv, config, set_flag, clear_flag |
179 | 218 | ): | ||
180 | 204 | config.return_value = {} | 219 | config.return_value = {} |
181 | 205 | unitdata_kv.return_value = {'url': 'http://10.22.22.22:8080'} | 220 | unitdata_kv.return_value = {'url': 'http://10.22.22.22:8080'} |
182 | 206 | jenkins_slave.configure_jenkins_slave() | 221 | jenkins_slave.configure_jenkins_slave() |
183 | @@ -253,10 +268,7 @@ class TestSetDefaultConf(unittest.TestCase): | |||
184 | 253 | @mock.patch('charms.reactive.set_flag') | 268 | @mock.patch('charms.reactive.set_flag') |
185 | 254 | def test_hook_slave_relation_changed_flags(self, set_flag, clear_flag): | 269 | def test_hook_slave_relation_changed_flags(self, set_flag, clear_flag): |
186 | 255 | jenkins_slave.slave_relation_changed() | 270 | jenkins_slave.slave_relation_changed() |
191 | 256 | expected = [ | 271 | expected = [mock.call('jenkins-slave.configured'), mock.call('slave-relation.configured')] |
188 | 257 | mock.call('jenkins-slave.configured'), | ||
189 | 258 | mock.call('slave-relation.configured'), | ||
190 | 259 | ] | ||
192 | 260 | self.assertFalse(clear_flag.assert_has_calls(expected, any_order=True)) | 272 | self.assertFalse(clear_flag.assert_has_calls(expected, any_order=True)) |
193 | 261 | self.assertFalse(set_flag.assert_has_calls([mock.call('slave-relation.available')], any_order=True)) | 273 | self.assertFalse(set_flag.assert_has_calls([mock.call('slave-relation.available')], any_order=True)) |
194 | 262 | 274 | ||
195 | @@ -273,28 +285,32 @@ class TestSetDefaultConf(unittest.TestCase): | |||
196 | 273 | @mock.patch('charmhelpers.core.unitdata.kv') | 285 | @mock.patch('charmhelpers.core.unitdata.kv') |
197 | 274 | @mock.patch('reactive.jenkins_slave.write_default_conf') | 286 | @mock.patch('reactive.jenkins_slave.write_default_conf') |
198 | 275 | def test_hook_slave_relation( | 287 | def test_hook_slave_relation( |
201 | 276 | self, write_default_conf, unitdata_kv, relation_set, relation_get, | 288 | self, write_default_conf, unitdata_kv, relation_set, relation_get, config, set_flag, clear_flag |
202 | 277 | config, set_flag, clear_flag): | 289 | ): |
203 | 278 | config.return_value = {'master_url': ''} | 290 | config.return_value = {'master_url': ''} |
204 | 279 | relation_get.return_value = 'http://10.1.1.1:8080' | 291 | relation_get.return_value = 'http://10.1.1.1:8080' |
205 | 280 | jenkins_slave.slave_relation() | 292 | jenkins_slave.slave_relation() |
206 | 281 | self.assertFalse(relation_get.assert_called_once_with('url')) | 293 | self.assertFalse(relation_get.assert_called_once_with('url')) |
207 | 282 | self.assertFalse(clear_flag.assert_called_once_with('jenkins-slave.active')) | 294 | self.assertFalse(clear_flag.assert_called_once_with('jenkins-slave.active')) |
208 | 283 | self.assertFalse(set_flag.assert_called_once_with('slave-relation.configured')) | 295 | self.assertFalse(set_flag.assert_called_once_with('slave-relation.configured')) |
213 | 284 | expected = [mock.call(executors=3), | 296 | expected = [ |
214 | 285 | mock.call(labels='x86_64'), | 297 | mock.call(executors=3), |
215 | 286 | mock.call(slavehost='mock-jenkins-slave-0'), | 298 | mock.call(labels='x86_64'), |
216 | 287 | mock.call(slaveaddress='10.1.2.3')] | 299 | mock.call(slavehost='mock-jenkins-slave-0'), |
217 | 300 | mock.call(slaveaddress='10.1.2.3'), | ||
218 | 301 | ] | ||
219 | 288 | self.assertFalse(relation_set.assert_has_calls(expected, any_order=True)) | 302 | self.assertFalse(relation_set.assert_has_calls(expected, any_order=True)) |
220 | 289 | 303 | ||
221 | 290 | config.return_value = {'master_url': '', 'labels': 'label1 label2'} | 304 | config.return_value = {'master_url': '', 'labels': 'label1 label2'} |
222 | 291 | relation_get.return_value = 'http://10.1.1.1:8080' | 305 | relation_get.return_value = 'http://10.1.1.1:8080' |
223 | 292 | relation_set.reset_mock() | 306 | relation_set.reset_mock() |
224 | 293 | jenkins_slave.slave_relation() | 307 | jenkins_slave.slave_relation() |
229 | 294 | expected = [mock.call(executors=3), | 308 | expected = [ |
230 | 295 | mock.call(labels='label1 label2'), | 309 | mock.call(executors=3), |
231 | 296 | mock.call(slavehost='mock-jenkins-slave-0'), | 310 | mock.call(labels='label1 label2'), |
232 | 297 | mock.call(slaveaddress='10.1.2.3')] | 311 | mock.call(slavehost='mock-jenkins-slave-0'), |
233 | 312 | mock.call(slaveaddress='10.1.2.3'), | ||
234 | 313 | ] | ||
235 | 298 | self.assertFalse(relation_set.assert_has_calls(expected, any_order=True)) | 314 | self.assertFalse(relation_set.assert_has_calls(expected, any_order=True)) |
236 | 299 | 315 | ||
237 | 300 | @mock.patch('charmhelpers.core.hookenv.config') | 316 | @mock.patch('charmhelpers.core.hookenv.config') |
238 | @@ -311,8 +327,7 @@ class TestSetDefaultConf(unittest.TestCase): | |||
239 | 311 | @mock.patch('charms.reactive.set_flag') | 327 | @mock.patch('charms.reactive.set_flag') |
240 | 312 | @mock.patch('charmhelpers.core.hookenv.config') | 328 | @mock.patch('charmhelpers.core.hookenv.config') |
241 | 313 | @mock.patch('charmhelpers.core.hookenv.relation_get') | 329 | @mock.patch('charmhelpers.core.hookenv.relation_get') |
244 | 314 | def test_hook_slave_relation_relation_url_not_set( | 330 | def test_hook_slave_relation_relation_url_not_set(self, relation_get, config, set_flag, clear_flag): |
243 | 315 | self, relation_get, config, set_flag, clear_flag): | ||
245 | 316 | config.return_value = {'master_url': ''} | 331 | config.return_value = {'master_url': ''} |
246 | 317 | relation_get.return_value = '' | 332 | relation_get.return_value = '' |
247 | 318 | jenkins_slave.slave_relation() | 333 | jenkins_slave.slave_relation() |
248 | @@ -326,8 +341,11 @@ class TestSetDefaultConf(unittest.TestCase): | |||
249 | 326 | nrpe_instance_mock = nrpe(get_nagios_hostname(), primary=True) | 341 | nrpe_instance_mock = nrpe(get_nagios_hostname(), primary=True) |
250 | 327 | jenkins_slave.configure_nagios(None) | 342 | jenkins_slave.configure_nagios(None) |
251 | 328 | status.maintenance.assert_called() | 343 | status.maintenance.assert_called() |
254 | 329 | want = [mock.call('jenkins_slave_ps', 'Jenkins Slave Process', | 344 | want = [ |
255 | 330 | '/usr/lib/nagios/plugins/check_procs -c 1:1 -a slave.jar')] | 345 | mock.call( |
256 | 346 | 'jenkins_slave_ps', 'Jenkins Slave Process', '/usr/lib/nagios/plugins/check_procs -c 1:1 -a slave.jar' | ||
257 | 347 | ) | ||
258 | 348 | ] | ||
259 | 331 | nrpe_instance_mock.add_check.assert_has_calls(want, any_order=True) | 349 | nrpe_instance_mock.add_check.assert_has_calls(want, any_order=True) |
260 | 332 | 350 | ||
261 | 333 | nrpe_instance_mock.write.assert_called() | 351 | nrpe_instance_mock.write.assert_called() |
262 | diff --git a/tox.ini b/tox.ini | |||
263 | index 99078b2..220ff5d 100644 | |||
264 | --- a/tox.ini | |||
265 | +++ b/tox.ini | |||
266 | @@ -20,6 +20,10 @@ basepython = python3 | |||
267 | 20 | commands = functest-run-suite --keep-model | 20 | commands = functest-run-suite --keep-model |
268 | 21 | deps = -r{toxinidir}/tests/functional/requirements.txt | 21 | deps = -r{toxinidir}/tests/functional/requirements.txt |
269 | 22 | 22 | ||
270 | 23 | [testenv:black] | ||
271 | 24 | commands = black --skip-string-normalization --line-length=120 . | ||
272 | 25 | deps = black | ||
273 | 26 | |||
274 | 23 | [testenv:lint] | 27 | [testenv:lint] |
275 | 24 | commands = flake8 | 28 | commands = flake8 |
276 | 25 | deps = flake8 | 29 | deps = flake8 |
This merge proposal is being monitored by mergebot. Change the status to Approved to merge.