Merge lp:~robru/cupstream2distro/pylint-experiment into lp:cupstream2distro

Proposed by Robert Bruce Park
Status: Merged
Merged at revision: 1188
Proposed branch: lp:~robru/cupstream2distro/pylint-experiment
Merge into: lp:cupstream2distro
Diff against target: 922 lines (+114/-133)
37 files modified
Makefile (+4/-2)
citrain/__init__.py (+1/-0)
citrain/abandon.py (+1/-1)
citrain/migration.py (+2/-2)
citrain/publisher.py (+2/-2)
citrain/recipes/__init__.py (+1/-0)
citrain/recipes/base.py (+20/-20)
citrain/recipes/binarysync.py (+1/-1)
citrain/recipes/manager.py (+1/-1)
citrain/recipes/merge.py (+11/-11)
citrain/recipes/secondary.py (+1/-1)
citrain/recipes/sourcesync.py (+1/-1)
citrain/setup_citrain.py (+3/-2)
cupstream2distro/__init__.py (+1/-0)
cupstream2distro/archive.py (+2/-3)
cupstream2distro/branchhandling.py (+2/-2)
cupstream2distro/errors.py (+2/-2)
cupstream2distro/packagemanager.py (+4/-3)
cupstream2distro/silomanager.py (+9/-10)
cupstream2distro/version.py (+2/-2)
find_bad_versions.py (+1/-0)
lp_api_explorer.py (+3/-3)
tests/unit/__init__.py (+4/-0)
tests/unit/test_archive.py (+5/-3)
tests/unit/test_recipe_base.py (+0/-4)
tests/unit/test_recipe_binarysync.py (+0/-7)
tests/unit/test_recipe_manual.py (+0/-7)
tests/unit/test_recipe_merge.py (+20/-20)
tests/unit/test_recipe_secondary.py (+0/-7)
tests/unit/test_recipe_sourcesync.py (+0/-7)
tests/unit/test_script_build.py (+2/-1)
tests/unit/test_script_merge_clean.py (+1/-1)
tests/unit/test_script_migration.py (+1/-1)
tests/unit/test_script_prepare_silo.py (+1/-1)
tests/unit/test_script_revert.py (+1/-1)
tests/unit/test_script_setup_citrain.py (+1/-1)
tests/unit/test_silomanager.py (+3/-3)
To merge this branch: bzr merge lp:~robru/cupstream2distro/pylint-experiment
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
CU2D maintainers Pending
Review via email: mp+276608@code.launchpad.net

Commit message

Gate on pylint.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1188
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/859/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/859/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1189
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/860/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/860/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1191
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/861/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/861/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1192
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/862/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/862/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1196
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/863/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/863/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1197
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/864/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/864/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1199
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/865/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/865/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1199
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/866/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/866/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1200
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/867/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/867/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1201
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/868/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/868/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1203
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/869/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/869/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1204
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/870/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/870/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1205
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/871/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/871/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1206
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/872/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/872/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1207
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/873/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/873/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1208
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/874/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/874/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1207
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/875/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/875/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1208
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/876/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/876/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1209
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/877/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/877/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-autolanding/320/
Executed test runs:

review: Needs Fixing (continuous-integration)
1210. By Robert Bruce Park

Fix unidiomatic-typecheck.

1211. By Robert Bruce Park

Fix logging-format-interpolation.

1212. By Robert Bruce Park

Locally disable too-many-locals.

1213. By Robert Bruce Park

Fix dangerous-default-value.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1211
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/878/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/878/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1197
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/879/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/879/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2015-10-28 02:17:31 +0000
3+++ Makefile 2015-11-04 16:08:56 +0000
4@@ -6,7 +6,9 @@
5 python3 -m coverage report --include='c*/*,t*/*' --show-missing --fail-under=100
6 find -name '*.xml*' | xargs xmllint --noout
7 find -name '*.py' | xargs pyflakes3
8- find -name '*.py' | xargs pep8 --ignore=E731
9+ find -name '*.py' | xargs pep8
10+ # TODO: Most of these disabled checks are python3isms. Either backport pylint3 to trusty or wait for production to be migrated to xenial and then audit which of these can be re-enabled.
11+ find -name '*.py' | xargs pylint --disable anomalous-unicode-escape-in-string,attribute-defined-outside-init,bad-option-value,broad-except,fixme,import-error,invalid-name,maybe-no-member,method-hidden,missing-super-argument,no-init,no-member,no-name-in-module,no-self-use,no-value-for-parameter,old-style-class,protected-access,star-args,superfluous-parens,too-few-public-methods,too-many-arguments,too-many-instance-attributes,too-many-public-methods,unbalanced-tuple-unpacking,undefined-variable,unexpected-keyword-arg,unused-argument,unused-variable
12
13 performance:
14 BEAT_THE_CLOCK=500 make check
15@@ -19,7 +21,7 @@
16 bzr log --line | sed -e 's/^[0-9]\+: \(.*\) 20[0-9].*/\1/' | sort | uniq -c | sort -rg | sed -e 's/^\s\+[0-9]\+/ /' >> AUTHORS
17
18 install-test-deps:
19- $(apt) libdistro-info-perl pyflakes pep8 language-pack-en python3-nose2 python3-coverage python3-mock python3-requests python3-launchpadlib python3-pep8 libxml2-utils
20+ $(apt) libdistro-info-perl pylint pyflakes pep8 language-pack-en python3-nose2 python3-coverage python3-mock python3-requests python3-launchpadlib python3-pep8 libxml2-utils
21
22 # Charm runs this as root.
23 install: install-test-deps
24
25=== modified file 'citrain/__init__.py'
26--- citrain/__init__.py 2014-09-11 15:40:13 +0000
27+++ citrain/__init__.py 2015-11-04 16:08:56 +0000
28@@ -0,0 +1,1 @@
29+"""CI Train Module"""
30
31=== modified file 'citrain/abandon.py'
32--- citrain/abandon.py 2015-10-28 06:12:50 +0000
33+++ citrain/abandon.py 2015-11-04 16:08:56 +0000
34@@ -42,7 +42,7 @@
35 :returns: 0, always.
36 """
37 try:
38- logging.info('Abandoning requestid {}...'.format(env.REQUEST_ID))
39+ logging.info('Abandoning requestid %s...', env.REQUEST_ID)
40 silo_state = SiloState(siloname=None, primary=False)
41 silo_state.requestid = env.REQUEST_ID
42 if silo_state._siloname:
43
44=== modified file 'citrain/migration.py'
45--- citrain/migration.py 2015-10-30 06:03:54 +0000
46+++ citrain/migration.py 2015-11-04 16:08:56 +0000
47@@ -47,11 +47,11 @@
48 silo_state.enforce_lock()
49 silo_state.lock_fd.close()
50 except BlockingIOError:
51- logging.info('Silo {} is in use, skipping.\n'.format(env.SILONAME))
52+ logging.info('Silo %s is in use, skipping.\n', env.SILONAME)
53 continue
54
55 if 'dirty' not in silo_state.tokenize():
56- logging.info('Inspecting silo {}:'.format(silo_state.ppa.web_link))
57+ logging.info('Inspecting silo %s:', silo_state.ppa.web_link)
58 manager = Manager(silo_state)
59 try:
60 manager.do('unbuilt')
61
62=== modified file 'citrain/publisher.py'
63--- citrain/publisher.py 2015-10-28 19:44:30 +0000
64+++ citrain/publisher.py 2015-11-04 16:08:56 +0000
65@@ -38,7 +38,7 @@
66 import logging
67
68 from citrain.recipes.manager import Manager
69-from cupstream2distro.errors import CITrainError, PublishError, NoStatusError
70+from cupstream2distro.errors import CITrainError, PublishError
71 from cupstream2distro.utils import env, run_script
72 from cupstream2distro.silomanager import SiloState
73
74@@ -58,7 +58,7 @@
75 silo_state.set_published()
76 except CITrainError as err:
77 logging.error(str(err))
78- if type(err) is not NoStatusError:
79+ if err.loud:
80 silo_state.status = 'Publish failed: ' + str(err)
81 silo_state.save_config()
82 return 1
83
84=== modified file 'citrain/recipes/__init__.py'
85--- citrain/recipes/__init__.py 2015-08-21 05:14:11 +0000
86+++ citrain/recipes/__init__.py 2015-11-04 16:08:56 +0000
87@@ -0,0 +1,1 @@
88+"""Recipes Module"""
89
90=== modified file 'citrain/recipes/base.py'
91--- citrain/recipes/base.py 2015-10-28 06:12:50 +0000
92+++ citrain/recipes/base.py 2015-11-04 16:08:56 +0000
93@@ -112,7 +112,7 @@
94
95 def clean_source(source):
96 """Clean all related source content from current silos."""
97- logging.info('Cleaning silo files associated with {}.'.format(source))
98+ logging.info('Cleaning silo files associated with %s.', source)
99 source_dir = SILO_DIR(source)
100 with suppress(OSError):
101 log_value_of.source_dir('Deleting!')
102@@ -245,7 +245,7 @@
103
104 def clean_phase(self):
105 """Delete files leftover from previous builds."""
106- logging.info('Deleting local {} files...'.format(self.name))
107+ logging.info('Deleting local %s files...', self.name)
108 clean_source(self.name)
109
110 def collect_phase(self):
111@@ -254,13 +254,13 @@
112
113 def build_phase(self):
114 """Build the source package in a chroot."""
115- logging.info('Building {} source package.'.format(self.name))
116+ logging.info('Building %s source package.', self.name)
117 prev_version = self.get_archive_version(self.dest)
118 self.build_package(self.series.name, prev_version)
119
120 def upload_phase(self):
121 """Upload this locally built package to the silo PPA."""
122- logging.info('Uploading {}.'.format(self.name))
123+ logging.info('Uploading %s.', self.name)
124 ours = self.get_package_version()
125 silo = self.get_archive_version(self.silo_ppa)
126 log_value_of.ours()
127@@ -277,7 +277,7 @@
128
129 :param silo_state: The SiloState instance representing the silo.
130 """
131- logging.info('Looking at PPA: {}'.format(silo_state.ppa.web_link))
132+ logging.info('Looking at PPA: %s', silo_state.ppa.web_link)
133 silo_state.status = 'Building.'
134 silo_state.save_config()
135
136@@ -299,7 +299,7 @@
137
138 :returns: One of 'build failed', 'depwait', 'success', or 'timeout'
139 """
140- logging.info('Watching {}...'.format(self.name))
141+ logging.info('Watching %s...', self.name)
142 arches = set(self.find_archive_arches(self.main_archive))
143 watcher = ArchWatcher(arches)
144 version = self.get_package_version()
145@@ -312,12 +312,12 @@
146 while True:
147 source = newest(self.silo_ppa, **kwargs)
148 if source is not None:
149- logging.info('Checking {} silo:'.format(source.display_name))
150+ logging.info('Checking %s silo:', source.display_name)
151 builds = [b for b in source.getBuilds() if watcher(b)]
152 success = 0
153 for build in builds:
154 state = build.buildstate
155- logging.info('{}: {}'.format(build.arch_tag, state))
156+ logging.info('%s: %s', build.arch_tag, state)
157 if state in BUILD_FAILURES:
158 self.failures.add(
159 '{} failed to build.'.format(self.name))
160@@ -353,7 +353,7 @@
161 def diff_phase(self):
162 """Generate a diff of the uploaded source compared to distro."""
163 if exists(self.path):
164- logging.info('Generating diff for {}...'.format(self.name))
165+ logging.info('Generating diff for %s...', self.name)
166 path = SILO_DIR('ubuntu', self.name)
167 dest_version = newest(
168 self.dest, source_name=self.name, distro_series=self.series)
169@@ -403,8 +403,9 @@
170 self.authorized = True
171 except ClientError:
172 self.authorized = False
173- logging.debug('{} authorized to upload {}? {}'.format(
174- self.blame, self.name, self.authorized))
175+ logging.debug(
176+ '%s authorized to upload %s? %s',
177+ self.blame, self.name, self.authorized)
178
179 def enforce_authorization(self):
180 """Enforce checkupload requirements."""
181@@ -424,8 +425,7 @@
182 """Ensure that dest archive has expected versions."""
183 if env.IGNORE_VERSIONDESTINATION != 'true':
184 if lp.is_distro_archive(self.dest):
185- logging.info(
186- 'Checking for new {} uploads at dest.'.format(self.name))
187+ logging.info('Checking for new %s uploads at dest.', self.name)
188 version = self.get_archive_version(self.dest, self.series)
189 supposed = self.dest_current_version
190 log_value_of.version('Dest archive has')
191@@ -450,8 +450,8 @@
192 self.published_version = version
193 else:
194 logging.warning(
195- '{} version {} not greater than {}, skipping.'.format(
196- self.name, version, dest_version))
197+ '%s version %s not greater than %s, skipping.',
198+ self.name, version, dest_version)
199 else:
200 self.copy_to_archive(source)
201 self.published_version = version
202@@ -467,7 +467,7 @@
203 version = self.published_version
204 log_value_of.version('Checking for')
205 self.states[self.name] = self.check_archive_migration(version)
206- logging.info('{}: {}'.format(self.name, self.states[self.name]))
207+ logging.info('%s: %s', self.name, self.states[self.name])
208
209 @staticmethod
210 def post_migration_phase(silo_state):
211@@ -490,8 +490,8 @@
212
213 :raises MergeError: If PPA versions don't match destination archive.
214 """
215- msg = 'Checking that {} has reached destination archive...'
216- logging.info(msg.format(self.name))
217+ msg = 'Checking that %s has reached destination archive...'
218+ logging.info(msg, self.name)
219 ours = self.get_archive_version(self.silo_ppa)
220 dest = self.get_archive_version(self.dest)
221 log_value_of.ours('Silo PPA version')
222@@ -514,10 +514,10 @@
223 @staticmethod
224 def post_nuke_phase(silo_state):
225 """Delete all packages from PPA and remove local silo dir."""
226- logging.info('Cleaning {} ppa.'.format(silo_state.ppa.web_link))
227+ logging.info('Cleaning %s ppa.', silo_state.ppa.web_link)
228 for source in silo_state.ppa.getPublishedSources():
229 if source.status != 'Deleted':
230- logging.info('Deleting {} ppa.'.format(source.display_name))
231+ logging.info('Deleting %s ppa.', source.display_name)
232 source.requestDeletion()
233 silo_dir = SILO_DIR()
234 assert not silo_dir.endswith('/silos/')
235
236=== modified file 'citrain/recipes/binarysync.py'
237--- citrain/recipes/binarysync.py 2015-10-27 19:35:44 +0000
238+++ citrain/recipes/binarysync.py 2015-11-04 16:08:56 +0000
239@@ -36,7 +36,7 @@
240
241 def upload_phase(self):
242 """Copy a package between PPAs, including binary packages."""
243- logging.info('Performing binary copy of {}.'.format(self.name))
244+ logging.info('Performing binary copy of %s.', self.name)
245 version = self.get_archive_version(
246 self.from_archive, series=self.from_series)
247 self.silo_ppa.copyPackage(
248
249=== modified file 'citrain/recipes/manager.py'
250--- citrain/recipes/manager.py 2015-10-27 19:35:44 +0000
251+++ citrain/recipes/manager.py 2015-11-04 16:08:56 +0000
252@@ -50,7 +50,7 @@
253 self.choose_packages()
254 self.choose_classes()
255 self.instantiate_build_objects()
256- logging.info('Including {}.'.format(', '.join(sorted(self.names))))
257+ logging.info('Including %s.', ', '.join(sorted(self.names)))
258 for phase in phases:
259 self.execute_phase(phase)
260
261
262=== modified file 'citrain/recipes/merge.py'
263--- citrain/recipes/merge.py 2015-10-27 19:35:44 +0000
264+++ citrain/recipes/merge.py 2015-11-04 16:08:56 +0000
265@@ -65,7 +65,7 @@
266 if get_pre(parent) == get_id(merge):
267 recurse_upwards(parent)
268
269- [recurse_upwards(leaf) for leaf in leafs]
270+ logging.debug([recurse_upwards(leaf) for leaf in leafs])
271 return ordered
272
273
274@@ -94,7 +94,7 @@
275 def check_for_unbuilt_revids(source, merges):
276 """Return a list of MPs that have new commits since last build."""
277 unbuilt = []
278- logging.info('Checking {} for new commits...'.format(source))
279+ logging.info('Checking %s for new commits...', source)
280 # TODO: check also the merge target revids, which only just started being
281 # recorded and need time to appear in production.
282 for merge in merges:
283@@ -130,14 +130,14 @@
284
285 def enforce_merge_states(self, acceptable):
286 """Block when merges have bad states."""
287- # (\/) (°,,,°) (\/)
288+ # (\/) (^,,,^) (\/)
289 your_merges_are_bad_and_you_should_feel_bad = False
290- logging.info('Checking states of {} merges...'.format(self.name))
291+ logging.info('Checking states of %s merges...', self.name)
292 for merge in self.merges:
293- url = getattr(merge, 'web_link', merge)
294+ url = getattr(merge, 'web_link', str(merge))
295 state = getattr(merge, 'queue_status', 'Not even a merge')
296 if state not in acceptable:
297- logging.error('{}: {}'.format(state, url))
298+ logging.error('%s: %s', state, url)
299 your_merges_are_bad_and_you_should_feel_bad = True
300 if your_merges_are_bad_and_you_should_feel_bad:
301 self.failures.add(self.name + ' has merges in bad states.')
302@@ -155,7 +155,7 @@
303 :raises BuildError: If merging fails, or if the destination archive has
304 a release that is missing from the trunk changelog.
305 """
306- logging.info('Preparing merges for {}.'.format(self.name))
307+ logging.info('Preparing merges for %s.', self.name)
308 merges = self.merges = reorder_branches(self.merges)
309 self.get_branch(merges[0].target_branch.web_link)
310 trunk_version = self.get_package_version()
311@@ -165,7 +165,7 @@
312 message = self.generate_commit_message(merge)
313 authors = self.get_remote_branch_authors(branch)
314 revno = merge.source_branch.revision_count
315- logging.info('Merging {} at r{}.'.format(branch, revno))
316+ logging.info('Merging %s at r%s.', branch, revno)
317 self.merge_branch(branch, message, authors)
318 self.verify_changelog_versions()
319 self.identify_versions()
320@@ -181,7 +181,7 @@
321 log_value_of.version('Highest')
322 new_version = V(version).create_new(series=self.series.version)
323 if self.preserve_package_version():
324- logging.info('Not mangling {} version.'.format(self.name))
325+ logging.info('Not mangling %s version.', self.name)
326 new_version = self.get_package_version()
327 self.refresh_package_versions(new_version)
328 authors = self.collect_changelog_contents()
329@@ -247,7 +247,7 @@
330 :returns: A dict mapping author names to commit messages, and
331 a list of bugs that have been fixed.
332 """
333- logging.info('Generating changelog for {}...'.format(self.name))
334+ logging.info('Generating changelog for %s...', self.name)
335 fixed = self.collect_package_bugs()
336 whole = env.TAKE_WHOLE_COMMIT_MESSAGE == 'true'
337 authors = self.get_branch_commits(fixed, take_whole_commit=whole)
338@@ -285,7 +285,7 @@
339 """Merge destination trunk back into local branch, if necessary."""
340 self.revert_branch()
341 target = self.merges[0].target_branch
342- logging.info('Merging {} to {}.'.format(target.web_link, self.path))
343+ logging.info('Merging %s to %s.', target.web_link, self.path)
344 self.merge_branch(target.web_link, 'Resync trunk.', unchanged=False)
345
346 def push_phase(self):
347
348=== modified file 'citrain/recipes/secondary.py'
349--- citrain/recipes/secondary.py 2015-10-27 19:35:44 +0000
350+++ citrain/recipes/secondary.py 2015-11-04 16:08:56 +0000
351@@ -56,7 +56,7 @@
352 def collect_phase(self):
353 """Copy an existing source package into a new directory."""
354 if isdir(self.primary_path):
355- logging.info('Creating secondary build in {}.'.format(self.path))
356+ logging.info('Creating secondary build in %s.', self.path)
357 shutil.copytree(self.primary_path, self.path, symlinks=True)
358 ver = V(self.get_package_version()).change_series(
359 self.series.version)
360
361=== modified file 'citrain/recipes/sourcesync.py'
362--- citrain/recipes/sourcesync.py 2015-10-27 19:35:44 +0000
363+++ citrain/recipes/sourcesync.py 2015-11-04 16:08:56 +0000
364@@ -60,7 +60,7 @@
365
366 def collect_phase(self):
367 """Download sync packages from the sync source."""
368- logging.info('Preparing source sync for {}.'.format(self.name))
369+ logging.info('Preparing source sync for %s.', self.name)
370 path = SILO_DIR()
371 from_dir = self.get_from_archive(
372 path, self.from_archive, self.from_series, status='Published')
373
374=== modified file 'citrain/setup_citrain.py'
375--- citrain/setup_citrain.py 2015-10-27 19:46:01 +0000
376+++ citrain/setup_citrain.py 2015-11-04 16:08:56 +0000
377@@ -80,11 +80,12 @@
378 return templ.read().format(**context)
379
380
381-def setup_job(jobname, template_name=None, context={}):
382+def setup_job(jobname, template_name=None, context=None):
383 """Populate templates and then write jenkins jobs to disk."""
384- logging.info('Configuring job {}.'.format(jobname))
385+ logging.info('Configuring job %s.', jobname)
386 log_value_of.jobname()
387 log_value_of.template_name()
388+ context = context or {}
389 context['BINDIR'] = CITRAIN_BINDIR
390 context['LIBDIR'] = ROOT_CU2D
391 context['RSYNC_OUTDIR'] = SILO_RSYNCDIR
392
393=== modified file 'cupstream2distro/__init__.py'
394--- cupstream2distro/__init__.py 2012-11-07 12:02:09 +0000
395+++ cupstream2distro/__init__.py 2015-11-04 16:08:56 +0000
396@@ -0,0 +1,1 @@
397+"""Canonical Upstream 2 Distro Module."""
398
399=== modified file 'cupstream2distro/archive.py'
400--- cupstream2distro/archive.py 2015-11-03 15:40:05 +0000
401+++ cupstream2distro/archive.py 2015-11-04 16:08:56 +0000
402@@ -116,8 +116,7 @@
403 :param archive: LP archive object to copy to, defaults to self.dest.
404 """
405 dest = archive or self.dest
406- logging.info('Copying {} to {}.'.format(
407- source.display_name, dest.web_link))
408+ logging.info('Copying %s to %s.', source.display_name, dest.web_link)
409 try:
410 dest.copyPackage(
411 from_archive=self.silo_ppa,
412@@ -160,7 +159,7 @@
413 with suppress(OSError):
414 os.makedirs(path)
415 version = source.source_package_version
416- logging.info('Downloading {} to {}'.format(source.display_name, path))
417+ logging.info('Downloading %s to %s', source.display_name, path)
418 for url in source.sourceFileUrls():
419 if url is None:
420 raise ArchiveError('Could not download source package.')
421
422=== modified file 'cupstream2distro/branchhandling.py'
423--- cupstream2distro/branchhandling.py 2015-10-22 23:02:45 +0000
424+++ cupstream2distro/branchhandling.py 2015-11-04 16:08:56 +0000
425@@ -135,7 +135,7 @@
426
427 :param url: Full URL to a bzr branch.
428 """
429- logging.info('Branching {} into {}.'.format(url, self.path))
430+ logging.info('Branching %s into %s.', url, self.path)
431 instance = log_call(
432 ['bzr', 'branch', url, self.path], cwd=dirname(self.path))[0]
433 if instance.returncode != 0:
434@@ -276,7 +276,7 @@
435 :raises: BranchError if branch is not writable by us.
436 """
437 assert branch.startswith('lp:'), branch
438- logging.info('Pushing {} to {}.'.format(self.name, branch))
439+ logging.info('Pushing %s to %s.', self.name, branch)
440 command = ['bzr', 'push', branch]
441 if overwrite:
442 command.append('--overwrite')
443
444=== modified file 'cupstream2distro/errors.py'
445--- cupstream2distro/errors.py 2015-09-22 18:51:46 +0000
446+++ cupstream2distro/errors.py 2015-11-04 16:08:56 +0000
447@@ -19,7 +19,7 @@
448
449 class CITrainError(Exception):
450 """Base Exception class for all CI Train error conditions."""
451- pass
452+ loud = True
453
454
455 class ArchiveError(CITrainError):
456@@ -69,4 +69,4 @@
457
458 class NoStatusError(PublishError):
459 """Special Exception that when raised won't set status."""
460- pass
461+ loud = False
462
463=== modified file 'cupstream2distro/packagemanager.py'
464--- cupstream2distro/packagemanager.py 2015-10-16 05:21:47 +0000
465+++ cupstream2distro/packagemanager.py 2015-11-04 16:08:56 +0000
466@@ -128,7 +128,7 @@
467 source_name=self.name, exact_match=True, order_by_date=True)
468 if sources:
469 return sources[0].component_name
470- logging.warning('Failed to find {} component name.'.format(self.name))
471+ logging.warning('Failed to find %s component name.', self.name)
472
473 def preserve_package_version(self):
474 """Determine whether or not to mangle package versions.
475@@ -169,7 +169,7 @@
476 dch_env = os.environ.copy()
477 dch_env.update(DEBFULLNAME=BOT_DEBFULLNAME, DEBEMAIL=BOT_DEBEMAIL)
478 for filename in sorted(replaced):
479- logging.info('Updated {} to latest version.'.format(filename))
480+ logging.info('Updated %s to latest version.', filename)
481 call(['dch', '--release-heuristic', 'changelog',
482 'debian/{}: update to released version.'.format(filename)],
483 cwd=self.path, env=dch_env)
484@@ -200,7 +200,8 @@
485 if dput.returncode != 0:
486 raise PackageError('dput failed: {}'.format(dput.returncode))
487
488- def generate_package_diffs(self, old_dsc, new_dsc):
489+ # TODO: Simplify this and drop the pylint disable.
490+ def generate_package_diffs(self, old_dsc, new_dsc): # pylint:disable=R0914
491 """Generate content and packaging-only diffs for this package."""
492 silo_dir = dirname(self.path)
493 full_path = join(silo_dir, FULL_DIFF.format(self.name))
494
495=== modified file 'cupstream2distro/silomanager.py'
496--- cupstream2distro/silomanager.py 2015-10-28 19:57:35 +0000
497+++ cupstream2distro/silomanager.py 2015-11-04 16:08:56 +0000
498@@ -135,12 +135,11 @@
499 response = requests.post(
500 api, data=json.dumps(kwargs), headers=JSON)
501 except IOError as err:
502- logging.error(
503- 'Failed to contact Bileto: {}'.format(scrub(str(err))))
504+ logging.error('Failed to contact Bileto: %s', scrub(str(err)))
505 return
506 if not response.ok:
507- logging.error('Bileto says: {} {}'.format(
508- response.status_code, response.reason))
509+ logging.error(
510+ 'Bileto says: %s %s', response.status_code, response.reason)
511
512
513 def update_bileto(**kwargs):
514@@ -190,7 +189,7 @@
515
516 def __init__(self, siloname=None, primary=False):
517 """Create a new SiloState object for an already-assigned silo."""
518- logging.debug('Instantiating {}'.format(siloname))
519+ logging.debug('Instantiating %s', siloname)
520 self.siloname = siloname
521 self._bileto = {}
522 self.strict = primary
523@@ -247,7 +246,7 @@
524
525 def validate_permissions(self):
526 """Ensure the user has permission to assign."""
527- logging.info('Checking LP teams for {}'.format(env.BUILD_USER_ID))
528+ logging.info('Checking LP teams for %s', env.BUILD_USER_ID)
529 memberships = lp.people[env.BUILD_USER_ID].memberships_details
530 teams = {member.team_link.split('~')[-1] for member in memberships}
531 if not teams & {'ubuntu-core-dev', 'ci-train-ppa-service'}:
532@@ -260,11 +259,11 @@
533 def find_existing_assignment(self):
534 """Find & re-use existing assignment if any."""
535 rid = self.requestid
536- logging.info('Checking if {} is in any other silo.'.format(rid))
537+ logging.info('Checking if %s is in any other silo.', rid)
538 request_id_file = self.REQUEST_ID_FILE.format(rid)
539 path = join(SILOS_DIR, '*', '*', request_id_file)
540 for result in sorted(glob(path)):
541- logging.warning('Request {} found in {}.'.format(rid, result))
542+ logging.warning('Request %s found in %s.', rid, result)
543 logging.warning('Remember, reconfiguring is no longer necessary!')
544 self.siloname = join(*result.split(os.sep)[-3:-1])
545 self.load_bileto()
546@@ -388,7 +387,7 @@
547 landers=self.landers,
548 merges='\n'.join(
549 ['\n'.join([url.web_link for url in urls])
550- for name, urls in sorted(self.mps.items())]),
551+ for name, urls in sorted(self.mps.items())]),
552 packages='\n'.join(
553 ['https://launchpad.net/ubuntu/+source/' + name
554 for name in self.all_projects]),
555@@ -492,7 +491,7 @@
556 yield source_name, merge
557 except (AssertionError, AttributeError, NotFound):
558 logging.error(
559- 'Failed to understand "{}". Is it a merge?'.format(url))
560+ 'Failed to understand "%s". Is it a merge?', url)
561
562 @property
563 @memoize
564
565=== modified file 'cupstream2distro/version.py'
566--- cupstream2distro/version.py 2015-10-15 19:37:06 +0000
567+++ cupstream2distro/version.py 2015-11-04 16:08:56 +0000
568@@ -28,9 +28,9 @@
569 RTM = {'14.09': '15.04'}
570
571
572-def comparison(one, cmp, two):
573+def comparison(one, comp, two):
574 """Compare version a against version b."""
575- process = call(['dpkg', '--compare-versions', str(one), cmp, str(two)])[0]
576+ process = call(['dpkg', '--compare-versions', str(one), comp, str(two)])[0]
577 return process.returncode == 0
578
579
580
581=== modified file 'find_bad_versions.py'
582--- find_bad_versions.py 2015-06-11 17:42:06 +0000
583+++ find_bad_versions.py 2015-11-04 16:08:56 +0000
584@@ -20,6 +20,7 @@
585
586
587 def get_bin_hashes(sourcepub):
588+ """Return the binary file sha1 hashes for comparison."""
589 hashes = {}
590 for binary in sourcepub.getPublishedBinaries():
591 urls = binary.binaryFileUrls(include_meta=True)[0]
592
593=== modified file 'lp_api_explorer.py'
594--- lp_api_explorer.py 2015-04-14 19:13:32 +0000
595+++ lp_api_explorer.py 2015-11-04 16:08:56 +0000
596@@ -4,16 +4,16 @@
597
598 from cmd import Cmd
599 from cupstream2distro.launchpadmanager import lp
600-from cupstream2distro import packagemanager as pm
601-lp, pm
602+IMPORTS = [lp] # Shut up pylint, this is used by the user.
603
604
605 class lpcmd(Cmd):
606+ """Provide an interactive LP API shell with cu2d tweaks."""
607 prompt = 'LP>>> '
608
609 def default(self, line):
610 try:
611- print(repr(eval(line.strip())))
612+ print(repr(eval(line.strip()))) # pylint: disable=eval-used
613 except NameError:
614 print('Bye!')
615 return True
616
617=== modified file 'tests/unit/__init__.py'
618--- tests/unit/__init__.py 2015-10-24 09:47:55 +0000
619+++ tests/unit/__init__.py 2015-11-04 16:08:56 +0000
620@@ -54,6 +54,10 @@
621 """Time how long each test runs."""
622 super().setUp()
623 self.start_time = time.time()
624+ self.source = Mock()
625+ self.dest = Mock()
626+ self.series = Mock()
627+ self.ppa = Mock()
628 env.SILONAME = self.tempdir
629
630 def tearDown(self):
631
632=== modified file 'tests/unit/test_archive.py'
633--- tests/unit/test_archive.py 2015-11-03 15:40:05 +0000
634+++ tests/unit/test_archive.py 2015-11-04 16:08:56 +0000
635@@ -29,8 +29,10 @@
636
637
638 class Listish(list):
639+ """Pretend to be a lazr collection."""
640 @property
641 def total_size(self):
642+ """Report the length of this object."""
643 return len(self)
644
645
646@@ -310,11 +312,11 @@
647 self.archive.name = 'dl'
648 os_mock.path.isdir.return_value = True
649 log_call.return_value = Mock(returncode=0), '', ''
650- self.assertEqual(
651- self.archive.unpack_archive_dsc(self.tempdir, '1.0-0ubuntu1'),
652- join(self.tempdir, 'dl'))
653 shortname = join(self.tempdir, 'dl')
654 fullname = shortname + '-1.0'
655+ self.assertEqual(
656+ self.archive.unpack_archive_dsc(self.tempdir, '1.0-0ubuntu1'),
657+ shortname)
658 log_call.assert_called_once_with(
659 ['dpkg-source', '-x', shortname + '_1.0-0ubuntu1.dsc'],
660 cwd=self.tempdir)
661
662=== modified file 'tests/unit/test_recipe_base.py'
663--- tests/unit/test_recipe_base.py 2015-10-27 19:35:44 +0000
664+++ tests/unit/test_recipe_base.py 2015-11-04 16:08:56 +0000
665@@ -71,10 +71,6 @@
666
667 def setUp(self):
668 super().setUp()
669- self.source = Mock()
670- self.dest = Mock()
671- self.series = Mock()
672- self.ppa = Mock()
673 BuildBase.failures.clear()
674 BuildBase.packagelist = None
675
676
677=== modified file 'tests/unit/test_recipe_binarysync.py'
678--- tests/unit/test_recipe_binarysync.py 2015-09-24 05:06:40 +0000
679+++ tests/unit/test_recipe_binarysync.py 2015-11-04 16:08:56 +0000
680@@ -26,13 +26,6 @@
681 class BinarySyncTestCase(DirectoryAwareTestCase):
682 """Test CI Train Binary Sync Recipe."""
683
684- def setUp(self):
685- super().setUp()
686- self.source = Mock()
687- self.dest = Mock()
688- self.series = Mock()
689- self.ppa = Mock()
690-
691 @patch('citrain.recipes.binarysync.BinarySync.get_archive_version', Mock())
692 def test_binarysync_upload_phase(self):
693 """Copy package binaries from one archive to another."""
694
695=== modified file 'tests/unit/test_recipe_manual.py'
696--- tests/unit/test_recipe_manual.py 2015-10-25 00:08:47 +0000
697+++ tests/unit/test_recipe_manual.py 2015-11-04 16:08:56 +0000
698@@ -27,13 +27,6 @@
699 class ManualTestCase(DirectoryAwareTestCase):
700 """Test CI Train Manual Recipe."""
701
702- def setUp(self):
703- super().setUp()
704- self.source = Mock()
705- self.dest = Mock()
706- self.series = Mock()
707- self.ppa = Mock()
708-
709 @patch('citrain.recipes.manual.Manual.get_archive_version', Mock())
710 def test_manual_get_package_version(self):
711 """Ensure that get_package_version calls get_archive_version."""
712
713=== modified file 'tests/unit/test_recipe_merge.py'
714--- tests/unit/test_recipe_merge.py 2015-10-27 18:56:27 +0000
715+++ tests/unit/test_recipe_merge.py 2015-11-04 16:08:56 +0000
716@@ -180,9 +180,9 @@
717 merge.validate_phase()
718 self.assertEqual(merge.failures, {'foo has merges in bad states.'})
719 self.assertEqual(log_mock.mock_calls, [
720- call.info('Checking states of foo merges...'),
721- call.error('Not even a merge: {}'),
722- call.error('Not even a merge: wat'),
723+ call.info('Checking states of %s merges...', 'foo'),
724+ call.error('%s: %s', 'Not even a merge', '{}'),
725+ call.error('%s: %s', 'Not even a merge', 'wat'),
726 ])
727
728 @patch('citrain.recipes.merge.logging')
729@@ -198,15 +198,15 @@
730 merge.validate_phase()
731 self.assertEqual(merge.failures, {'bar has merges in bad states.'})
732 self.assertEqual(log_mock.mock_calls, [
733- call.info('Checking states of bar merges...'),
734- call.info('Checking states of bar merges...'),
735- call.info('Checking states of bar merges...'),
736- call.info('Checking states of bar merges...'),
737- call.error('Superceded: example.com'),
738- call.info('Checking states of bar merges...'),
739- call.error('Rejected: example.com'),
740- call.info('Checking states of bar merges...'),
741- call.error('Really broken: example.com'),
742+ call.info('Checking states of %s merges...', 'bar'),
743+ call.info('Checking states of %s merges...', 'bar'),
744+ call.info('Checking states of %s merges...', 'bar'),
745+ call.info('Checking states of %s merges...', 'bar'),
746+ call.error('%s: %s', 'Superceded', 'example.com'),
747+ call.info('Checking states of %s merges...', 'bar'),
748+ call.error('%s: %s', 'Rejected', 'example.com'),
749+ call.info('Checking states of %s merges...', 'bar'),
750+ call.error('%s: %s', 'Really broken', 'example.com'),
751 ])
752
753 def test_merge_validate_phase_targets(self):
754@@ -421,14 +421,14 @@
755 merge.unapproved_phase()
756 self.assertEqual(merge.failures, {'grill has merges in bad states.'})
757 self.assertEqual(log_mock.mock_calls, [
758- call.info('Checking states of grill merges...'),
759- call.info('Checking states of grill merges...'),
760- call.info('Checking states of grill merges...'),
761- call.error('Superceded: example.com'),
762- call.info('Checking states of grill merges...'),
763- call.error('Work in progress: example.com'),
764- call.info('Checking states of grill merges...'),
765- call.error('Needs review: example.com'),
766+ call.info('Checking states of %s merges...', 'grill'),
767+ call.info('Checking states of %s merges...', 'grill'),
768+ call.info('Checking states of %s merges...', 'grill'),
769+ call.error('%s: %s', 'Superceded', 'example.com'),
770+ call.info('Checking states of %s merges...', 'grill'),
771+ call.error('%s: %s', 'Work in progress', 'example.com'),
772+ call.info('Checking states of %s merges...', 'grill'),
773+ call.error('%s: %s', 'Needs review', 'example.com'),
774 ])
775
776 def test_merge_unapproved_phase_disabled(self):
777
778=== modified file 'tests/unit/test_recipe_secondary.py'
779--- tests/unit/test_recipe_secondary.py 2015-10-24 20:50:45 +0000
780+++ tests/unit/test_recipe_secondary.py 2015-11-04 16:08:56 +0000
781@@ -30,13 +30,6 @@
782 class SecondaryTestCase(DirectoryAwareTestCase):
783 """Test CI Train Secondary Recipe."""
784
785- def setUp(self):
786- super().setUp()
787- self.source = Mock()
788- self.dest = Mock()
789- self.series = Mock()
790- self.ppa = Mock()
791-
792 @patch(MOD + 'lp')
793 @patch(MOD + 'Secondary.upload_package', Mock())
794 @patch(MOD + 'Secondary.get_from_archive', Mock())
795
796=== modified file 'tests/unit/test_recipe_sourcesync.py'
797--- tests/unit/test_recipe_sourcesync.py 2015-10-27 19:35:44 +0000
798+++ tests/unit/test_recipe_sourcesync.py 2015-11-04 16:08:56 +0000
799@@ -30,13 +30,6 @@
800 class SourceSyncTestCase(DirectoryAwareTestCase):
801 """Test CI Train Source Sync Recipe."""
802
803- def setUp(self):
804- super().setUp()
805- self.source = Mock()
806- self.dest = Mock()
807- self.series = Mock()
808- self.ppa = Mock()
809-
810 @patch(MOD + 'glob')
811 @patch(MOD + 'remove')
812 @patch(MOD + 'shutil')
813
814=== modified file 'tests/unit/test_script_build.py'
815--- tests/unit/test_script_build.py 2015-10-28 19:40:12 +0000
816+++ tests/unit/test_script_build.py 2015-11-04 16:08:56 +0000
817@@ -24,7 +24,7 @@
818
819 # Unused import necessary for code coverage reporting
820 from citrain import build as build_module
821-build_module
822+COVERAGE = [build_module]
823
824
825 class BuildTestCase(CITrainScriptTestCase):
826@@ -156,6 +156,7 @@
827 errs = [BuildError('It asploded!')]
828
829 def raise_errs(*ignore):
830+ """Raise an error if there's one to be raised."""
831 if errs:
832 raise errs.pop()
833 silo_state = self.script.SiloState.return_value
834
835=== modified file 'tests/unit/test_script_merge_clean.py'
836--- tests/unit/test_script_merge_clean.py 2015-10-28 19:40:12 +0000
837+++ tests/unit/test_script_merge_clean.py 2015-11-04 16:08:56 +0000
838@@ -24,7 +24,7 @@
839
840 # Unused import necessary for code coverage reporting
841 from citrain import merge_clean
842-merge_clean
843+COVERAGE = [merge_clean]
844
845
846 class MergeCleanTestCase(CITrainScriptTestCase):
847
848=== modified file 'tests/unit/test_script_migration.py'
849--- tests/unit/test_script_migration.py 2015-10-30 06:03:54 +0000
850+++ tests/unit/test_script_migration.py 2015-11-04 16:08:56 +0000
851@@ -26,7 +26,7 @@
852
853 # Unused import necessary for code coverage reporting
854 from citrain import migration
855-migration
856+COVERAGE = [migration]
857
858
859 class MigrationTestCase(CITrainScriptTestCase):
860
861=== modified file 'tests/unit/test_script_prepare_silo.py'
862--- tests/unit/test_script_prepare_silo.py 2015-09-14 19:55:26 +0000
863+++ tests/unit/test_script_prepare_silo.py 2015-11-04 16:08:56 +0000
864@@ -23,7 +23,7 @@
865
866 # Unused import necessary for code coverage reporting
867 from citrain import prepare_silo
868-prepare_silo
869+COVERAGE = [prepare_silo]
870
871
872 FAKE_PROJECTS = ['foo', 'bar', 'grill']
873
874=== modified file 'tests/unit/test_script_revert.py'
875--- tests/unit/test_script_revert.py 2015-10-25 00:12:42 +0000
876+++ tests/unit/test_script_revert.py 2015-11-04 16:08:56 +0000
877@@ -24,7 +24,7 @@
878
879 # Unused import necessary for code coverage reporting
880 from citrain import revert as revert_module
881-revert_module
882+COVERAGE = [revert_module]
883
884
885 class ReverterTestCase(CITrainScriptTestCase):
886
887=== modified file 'tests/unit/test_script_setup_citrain.py'
888--- tests/unit/test_script_setup_citrain.py 2015-10-27 20:15:30 +0000
889+++ tests/unit/test_script_setup_citrain.py 2015-11-04 16:08:56 +0000
890@@ -31,7 +31,7 @@
891
892 # Unused import necessary for code coverage reporting
893 from citrain import setup_citrain
894-setup_citrain
895+COVERAGE = [setup_citrain]
896
897
898 class SetupCITrainTestCase(CITrainScriptTestCase):
899
900=== modified file 'tests/unit/test_silomanager.py'
901--- tests/unit/test_silomanager.py 2015-10-28 19:21:29 +0000
902+++ tests/unit/test_silomanager.py 2015-11-04 16:08:56 +0000
903@@ -583,8 +583,8 @@
904 self.state._bileto.update(merge_proposals='')
905 self.state.push_to_bileto()
906 self.assertEqual(log_mock.error.mock_calls, [
907- call('Failed to contact Bileto: token=XXX'),
908- call('Failed to contact Bileto: token=XXX'),
909+ call('Failed to contact Bileto: %s', 'token=XXX'),
910+ call('Failed to contact Bileto: %s', 'token=XXX'),
911 ])
912
913 @patch('cupstream2distro.silomanager.SiloState.sources', [])
914@@ -779,7 +779,7 @@
915 self.assertEqual(self.state.mps, {})
916 self.assertEqual(lp_mock.load.mock_calls, [])
917 log.error.assert_called_once_with(
918- 'Failed to understand "not-a-url". Is it a merge?')
919+ 'Failed to understand "%s". Is it a merge?', 'not-a-url')
920
921 def test_silomanager_tokenize(self):
922 """Convert silo statuses into tokens sensibly."""

Subscribers

People subscribed via source and target branches