Merge lp:~pwlars/checkbox/remove-date-snap_packages into lp:checkbox

Proposed by Paul Larson
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 4372
Merged at revision: 4383
Proposed branch: lp:~pwlars/checkbox/remove-date-snap_packages
Merge into: lp:checkbox
Diff against target: 68 lines (+27/-5)
4 files modified
checkbox-support/checkbox_support/parsers/submission.py (+4/-4)
checkbox-support/checkbox_support/parsers/tests/fixtures/submission_snap_packages.xml (+0/-1)
checkbox-support/checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml (+12/-0)
checkbox-support/checkbox_support/parsers/tests/test_submission.py (+11/-0)
To merge this branch: bzr merge lp:~pwlars/checkbox/remove-date-snap_packages
Reviewer Review Type Date Requested Status
Sylvain Pineau Approve
Paul Larson Needs Resubmitting
Sheila Miguez (community) Approve
Maciej Kisielewski Approve
Review via email: mp+295504@code.launchpad.net

Description of the change

Remove the date field in snap_packages from checkbox_support

Snappy series 16 no longer returns date in 'snap list', so we should not require it

To post a comment you must log in.
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

Look okay, I guess :-)

review: Approve
Revision history for this message
Sheila Miguez (codersquid) wrote :

I asked about the removal of the date field vs. defaulting missing ones to ''; but plars explained it is gone. Plus, things are in flux and it is easy to add new or old fields again later.

review: Approve
Revision history for this message
Paul Larson (pwlars) wrote :

Resubmitted so that it should work with/without the date field, and added a test so that it's checked both ways.

review: Needs Resubmitting
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

If defaulting on missing fields (other than the date) is desired, I'm +1 on that.

Revision history for this message
Paul Larson (pwlars) wrote :

I think so, we should discuss. I'd personally think it's better to have the submission work, and see that maybe you are missing some important data, rather than go looking for the submission later and have it just tell you that it's still importing and have no idea if it's actually failing to import or why.

Revision history for this message
Paul Larson (pwlars) wrote :

Based on the reviews and discussion so far, I'm going to go ahead and land this. I believe the corresponding changes are also in the process of landing on the certification server side.

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :
Download full text (10.0 KiB)

The attempt to merge lp:~pwlars/checkbox/remove-date-snap_packages into lp:checkbox failed. Below is the output from the failed tests.

[precise] starting container
[precise] (timing) 0.09user 0.08system 0:04.35elapsed 4%CPU (0avgtext+0avgdata 10248maxresident)k
[precise] (timing) 0inputs+32outputs (0major+8256minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 47.37user 19.38system 1:17.48elapsed 86%CPU (0avgtext+0avgdata 96272maxresident)k
[precise] (timing) 0inputs+19064outputs (0major+3211100minor)pagefaults 0swaps
[precise-testing] Starting tests...
Found a test script: ./checkbox-ng/requirements/container-tests-checkbox-ng-unit
[precise-testing] container-tests-checkbox-ng-unit: PASS
[precise-testing] (timing) 0.72user 0.14system 0:00.88elapsed 98%CPU (0avgtext+0avgdata 48332maxresident)k
[precise-testing] (timing) 0inputs+1384outputs (0major+22237minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: FAIL
[precise-testing] stdout: http://paste.ubuntu.com/16685127/
[precise-testing] stderr: http://paste.ubuntu.com/16685128/
[precise-testing] (timing) Command exited with non-zero status 1
[precise-testing] (timing) 31.75user 0.26system 0:32.08elapsed 99%CPU (0avgtext+0avgdata 151168maxresident)k
[precise-testing] (timing) 0inputs+1368outputs (0major+39340minor)pagefaults 0swaps
Found a test script: ./checkbox-touch/requirements/container-tests-touch-unit-tests
[precise-testing] container-tests-touch-unit-tests: PASS
[precise-testing] (timing) 0.01user 0.01system 0:00.03elapsed 76%CPU (0avgtext+0avgdata 2184maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+2375minor)pagefaults 0swaps
Found a test script: ./plainbox/plainbox/impl/providers/categories/requirements/container-tests-provider-categories
[precise-testing] container-tests-provider-categories: PASS
[precise-testing] (timing) 1.07user 0.10system 0:01.19elapsed 98%CPU (0avgtext+0avgdata 46056maxresident)k
[precise-testing] (timing) 0inputs+64outputs (0major+14191minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/001-container-tests-plainbox-egg-info
[precise-testing] 001-container-tests-plainbox-egg-info: PASS
[precise-testing] (timing) 0.30user 0.08system 0:00.40elapsed 97%CPU (0avgtext+0avgdata 20244maxresident)k
[precise-testing] (timing) 0inputs+88outputs (0major+11869minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: PASS
[precise-testing] (timing) 53.70user 1.61system 0:55.50elapsed 99%CPU (0avgtext+0avgdata 198536maxresident)k
[precise-testing] (timing) 0inputs+3264outputs (0major+196522minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox-documentation
[precise-testing] container-tests-plainbox-documentation: PASS
[precise-testing] (timing) 154.10user 0.73system 2:35.07elapsed 99%CPU (0avgtext+0avgdata 186928maxresident)k
[precise-testing] (timing) 0inputs+43184outputs (0major+57218minor)page...

4372. By Paul Larson

Remove the date field in snap_packages from checkbox_support

Snappy series 16 no longer returns date in 'snap list', so we should not require it

Revision history for this message
Paul Larson (pwlars) wrote :

Oops, forgot one datafile for the new unit test

review: Needs Resubmitting
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Thanks for the fix Paul, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-support/checkbox_support/parsers/submission.py'
2--- checkbox-support/checkbox_support/parsers/submission.py 2016-02-10 09:29:24 +0000
3+++ checkbox-support/checkbox_support/parsers/submission.py 2016-05-27 12:25:37 +0000
4@@ -857,10 +857,10 @@
5
6 def addSnapPackage(self, snap_package):
7 snap_package_version = {
8- "name": snap_package["name"],
9- "date": snap_package["properties"]["date"],
10- "version": snap_package["properties"]["version"],
11- "developer": snap_package["properties"]["developer"],
12+ "name": snap_package.get("name"),
13+ "version": snap_package.get("properties", {}).get("version"),
14+ "date": snap_package.get("properties", {}).get("date"),
15+ "developer": snap_package.get("properties", {}).get("developer"),
16 }
17 self.dispatcher.publishEvent(
18 "snap_package_version", snap_package_version)
19
20=== modified file 'checkbox-support/checkbox_support/parsers/tests/fixtures/submission_snap_packages.xml'
21--- checkbox-support/checkbox_support/parsers/tests/fixtures/submission_snap_packages.xml 2015-10-19 19:03:48 +0000
22+++ checkbox-support/checkbox_support/parsers/tests/fixtures/submission_snap_packages.xml 2016-05-27 12:25:37 +0000
23@@ -3,7 +3,6 @@
24 <software>
25 <snap_packages>
26 <snap_package id="0" name="ubuntu-core">
27-<property name="date" type="str">2015-10-13</property>
28 <property name="version" type="str">14</property>
29 <property name="developer" type="str">ubuntu</property>
30 </snap_package>
31
32=== added file 'checkbox-support/checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml'
33--- checkbox-support/checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml 1970-01-01 00:00:00 +0000
34+++ checkbox-support/checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml 2016-05-27 12:25:37 +0000
35@@ -0,0 +1,12 @@
36+<?xml version="1.0" ?>
37+<system version="1.0">
38+<software>
39+<snap_packages>
40+<snap_package id="0" name="ubuntu-core">
41+<property name="version" type="str">14</property>
42+<property name="date" type="str">2015-10-13</property>
43+<property name="developer" type="str">ubuntu</property>
44+</snap_package>
45+</snap_packages>
46+</software>
47+</system>
48
49=== modified file 'checkbox-support/checkbox_support/parsers/tests/test_submission.py'
50--- checkbox-support/checkbox_support/parsers/tests/test_submission.py 2016-02-02 20:58:17 +0000
51+++ checkbox-support/checkbox_support/parsers/tests/test_submission.py 2016-05-27 12:25:37 +0000
52@@ -349,6 +349,17 @@
53 package_version = result["snap_package_versions"][0]
54 self.assertEqual(package_version["name"], "ubuntu-core")
55 self.assertEqual(package_version["version"], "14")
56+ self.assertEqual(package_version["developer"], "ubuntu")
57+
58+ def test_snap_package_versions_with_date(self):
59+ """Snap Package parses correctly with optional date element."""
60+ result = self.getResult("submission_snap_packages_with_date.xml")
61+ self.assertTrue("snap_package_versions" in result)
62+ self.assertEqual(len(result["snap_package_versions"]), 1)
63+
64+ package_version = result["snap_package_versions"][0]
65+ self.assertEqual(package_version["name"], "ubuntu-core")
66+ self.assertEqual(package_version["version"], "14")
67 self.assertEqual(package_version["date"], "2015-10-13")
68 self.assertEqual(package_version["developer"], "ubuntu")
69

Subscribers

People subscribed via source and target branches