Merge lp:~robru/cupstream2distro/fix-watching-new-sources into lp:cupstream2distro

Proposed by Robert Bruce Park on 2015-01-13
Status: Merged
Approved by: Robert Bruce Park on 2015-01-13
Approved revision: 864
Merged at revision: 863
Proposed branch: lp:~robru/cupstream2distro/fix-watching-new-sources
Merge into: lp:cupstream2distro
Diff against target: 61 lines (+32/-8)
2 files modified
citrain/watch_ppa.py (+10/-8)
tests/unit/test_script_watch_ppa.py (+22/-0)
To merge this branch: bzr merge lp:~robru/cupstream2distro/fix-watching-new-sources
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Approve on 2015-01-13
PS Jenkins bot continuous-integration Approve on 2015-01-13
Review via email: mp+246332@code.launchpad.net

Commit Message

Fix supported arch list for new source packages.

Description of the Change

Fix supported arch list for new source packages.

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote :

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

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

review: Approve (continuous-integration)
Robert Bruce Park (robru) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'citrain/watch_ppa.py'
2--- citrain/watch_ppa.py 2014-12-03 05:25:41 +0000
3+++ citrain/watch_ppa.py 2015-01-13 17:51:26 +0000
4@@ -90,14 +90,16 @@
5 package.
6 """
7 series = lp.load(silo_state.series)
8- source_collection = dest.getPublishedSources(
9- exact_match=True,
10- source_name=source_name,
11- distro_series=series,
12- status='Published',
13- )
14- previous_source = packagemanager.sort_by_date_created(source_collection)[0]
15- for binary in previous_source.getPublishedBinaries():
16+ source_collection = packagemanager.sort_by_date_created(
17+ dest.getPublishedSources(
18+ exact_match=True,
19+ source_name=source_name,
20+ distro_series=series,
21+ status='Published',
22+ ))
23+ if not source_collection:
24+ return
25+ for binary in source_collection[0].getPublishedBinaries():
26 # Must check architecture_specific field to filter out false positives
27 # caused by Arch:all packages showing up even on arches that we don't
28 # expect builds to succeed on.
29
30=== modified file 'tests/unit/test_script_watch_ppa.py'
31--- tests/unit/test_script_watch_ppa.py 2014-12-03 06:12:10 +0000
32+++ tests/unit/test_script_watch_ppa.py 2015-01-13 17:51:26 +0000
33@@ -139,6 +139,28 @@
34 self.script.packagemanager.sort_by_date_created\
35 .assert_called_once_with(dest.getPublishedSources())
36
37+ def test_find_supported_arches_none(self):
38+ """Return set() when no package exists at destination."""
39+ binaries = []
40+ source = Mock()
41+ source.getPublishedBinaries.return_value = binaries
42+ dest = Mock()
43+ dest.getPublishedSources.return_value = [source]
44+ self.script.packagemanager.sort_by_date_created.return_value = []
45+ self.assertEqual(
46+ sorted(self.script.find_supported_arches(dest, 'foo')),
47+ [])
48+ self.script.lp.load.assert_called_once_with(
49+ self.script.silo_state.series)
50+ dest.getPublishedSources.assert_called_once_with(
51+ exact_match=True,
52+ source_name='foo',
53+ distro_series=self.script.lp.load(),
54+ status='Published',
55+ )
56+ self.script.packagemanager.sort_by_date_created\
57+ .assert_called_once_with(dest.getPublishedSources())
58+
59 def test_find_all_uploaded(self):
60 """Find everything that has been uploaded from this silo."""
61 self.script.find_all.return_value = [

Subscribers

People subscribed via source and target branches