Merge lp:~fginther/phablet-tools/skip-missing-click-tests into lp:phablet-tools

Proposed by Francis Ginther
Status: Rejected
Rejected by: Robert Bruce Park
Proposed branch: lp:~fginther/phablet-tools/skip-missing-click-tests
Merge into: lp:phablet-tools
Diff against target: 73 lines (+30/-12)
1 file modified
phablet-click-test-setup (+30/-12)
To merge this branch: bzr merge lp:~fginther/phablet-tools/skip-missing-click-tests
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Robert Bruce Park (community) Approve
Review via email: mp+256931@code.launchpad.net

Commit message

Generate an error when copying test sources for any given click and move on to the next.

Description of the change

Generate an error when copying test sources for any given click and move on to the next.

The click manifest files point to a bzr branch to acquire the test sources, however, there is no mechanism to change the default location within the bzr branch or deal with test sources that may have moved do a different branch after the click package has been published. This change at least skips over these packages so that others can be installed.

To post a comment you must log in.
340. By Francis Ginther

Fix errors.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
341. By Francis Ginther

Add hack for downloading source packages from the overlay PPA.

Revision history for this message
Robert Bruce Park (robru) wrote :

Mostly looks good, some nitpicks inline.

review: Approve
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

A few comments.

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

Unmerged revisions

341. By Francis Ginther

Add hack for downloading source packages from the overlay PPA.

340. By Francis Ginther

Fix errors.

339. By Francis Ginther

Add CalledProcessError handling.

338. By Francis Ginther

Ignore errors when copying test sources.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phablet-click-test-setup'
2--- phablet-click-test-setup 2014-09-29 16:30:56 +0000
3+++ phablet-click-test-setup 2015-04-21 22:13:08 +0000
4@@ -20,7 +20,7 @@
5 from launchpadlib.launchpad import Launchpad
6 from phabletutils.device import AndroidBridge
7 from os import path
8-from subprocess import (check_call, check_output)
9+from subprocess import (check_call, check_output, CalledProcessError)
10
11 import argparse
12 import atexit
13@@ -55,6 +55,10 @@
14 self._series = distro.getSeries(name_or_version=release)
15 self._arch_series = self._series.getDistroArchSeries(archtag=arch)
16 self._archive = self.lp.distributions[distribution].main_archive
17+ ppa_list = self.lp.people['ci-train-ppa-service'].ppas
18+ for p in ppa_list:
19+ if p.name == 'stable-phone-overlay':
20+ self._ppa = p
21
22
23 lp = None
24@@ -157,13 +161,22 @@
25 atexit.register(cleanup, tmp_dir)
26 print('Fetching %s - into %s' % (package, tmp_dir))
27 try:
28- sp = lp.archive.getPublishedSources(
29- source_name=package,
30- version=version,
31- distro_series=lp.series,
32- exact_match=True)
33- # TODO needs filtering
34- source_url = sp[0].sourceFileUrls()[0]
35+ try:
36+ sp = lp.archive.getPublishedSources(
37+ source_name=package,
38+ version=version,
39+ distro_series=lp.series,
40+ exact_match=True)
41+ # TODO needs filtering
42+ source_url = sp[0].sourceFileUrls()[0]
43+ except IndexError as e:
44+ sp = lp._ppa.getPublishedSources(
45+ source_name=package,
46+ version=version,
47+ distro_series=lp.series,
48+ exact_match=True)
49+ # TODO needs filtering
50+ source_url = sp[0].sourceFileUrls()[0]
51 print('Downloading %s version %s from %s' % (package,
52 version, source_url))
53 url = urllib2.urlopen(source_url)
54@@ -234,10 +247,15 @@
55 print('Only keeping entries with x-source')
56 manifest = [entry for entry in manifest if 'x-source' in entry]
57 for entry in manifest:
58- get_bzr_tests(entry['x-source']['vcs-bzr'],
59- entry['x-source']['vcs-bzr-revno'],
60- 'tests/autopilot',
61- test_dir)
62+ try:
63+ get_bzr_tests(entry['x-source']['vcs-bzr'],
64+ entry['x-source']['vcs-bzr-revno'],
65+ 'tests/autopilot',
66+ test_dir)
67+ except (CalledProcessError, OSError) as e:
68+ print('Error: unable to acquire test sources for {}, '
69+ 'continuing.'.format(entry['name']))
70+ print('Error: {}'.format(e))
71
72
73 def main():

Subscribers

People subscribed via source and target branches