Merge ~sylvain-pineau/checkbox-support:fix-1647670 into checkbox-support:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 608d5689c17843f7d09073fe1ab828fbba61122e
Merged at revision: c8e0fb4fdadc9297eeabe9f72d64ffcd8ca1e261
Proposed branch: ~sylvain-pineau/checkbox-support:fix-1647670
Merge into: checkbox-support:master
Diff against target: 65 lines (+21/-10)
3 files modified
checkbox_support/parsers/submission.py (+4/-1)
checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml (+10/-5)
checkbox_support/parsers/tests/test_submission.py (+7/-4)
Reviewer Review Type Date Requested Status
Maciej Kisielewski Approve
Review via email: mp+312557@code.launchpad.net

Description of the change

Fixes linked bug by adding the missing field to the submission parser.
Tested using "plainbox dev parse submission". All the new fields are in the json output:

http://pastebin.ubuntu.com/23588321/ (line 11354)

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

LGTM! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_support/parsers/submission.py b/checkbox_support/parsers/submission.py
2index d6ab8a6..f117c29 100644
3--- a/checkbox_support/parsers/submission.py
4+++ b/checkbox_support/parsers/submission.py
5@@ -859,8 +859,11 @@ class SubmissionResult(object):
6 snap_package_version = {
7 "name": snap_package.get("name"),
8 "version": snap_package.get("properties", {}).get("version"),
9- "date": snap_package.get("properties", {}).get("date"),
10+ "install-date": snap_package.get("properties", {}).get("install-date"),
11 "developer": snap_package.get("properties", {}).get("developer"),
12+ "confinement": snap_package.get("properties", {}).get("confinement"),
13+ "revision": snap_package.get("properties", {}).get("revision"),
14+ "channel": snap_package.get("properties", {}).get("channel"),
15 }
16 self.dispatcher.publishEvent(
17 "snap_package_version", snap_package_version)
18diff --git a/checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml b/checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml
19index 8579897..2ee6a92 100644
20--- a/checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml
21+++ b/checkbox_support/parsers/tests/fixtures/submission_snap_packages_with_date.xml
22@@ -2,11 +2,16 @@
23 <system version="1.0">
24 <software>
25 <snap_packages>
26-<snap_package id="0" name="ubuntu-core">
27-<property name="version" type="str">14</property>
28-<property name="date" type="str">2015-10-13</property>
29-<property name="developer" type="str">ubuntu</property>
30-</snap_package>
31+ <snap_package id="0" name="core">
32+ <property name="channel" type="str">edge</property>
33+ <property name="confinement" type="str">strict</property>
34+ <property name="developer" type="str">canonical</property>
35+ <property name="devmode" type="str">False</property>
36+ <property name="install-date" type="str">2016-12-05T16:07:14+01:00</property>
37+ <property name="revision" type="str">620</property>
38+ <property name="type" type="str">os</property>
39+ <property name="version" type="str">16.04.1</property>
40+ </snap_package>
41 </snap_packages>
42 </software>
43 </system>
44diff --git a/checkbox_support/parsers/tests/test_submission.py b/checkbox_support/parsers/tests/test_submission.py
45index e51e664..b1075a3 100644
46--- a/checkbox_support/parsers/tests/test_submission.py
47+++ b/checkbox_support/parsers/tests/test_submission.py
48@@ -358,10 +358,13 @@ class TestSubmissionParser(TestCase):
49 self.assertEqual(len(result["snap_package_versions"]), 1)
50
51 package_version = result["snap_package_versions"][0]
52- self.assertEqual(package_version["name"], "ubuntu-core")
53- self.assertEqual(package_version["version"], "14")
54- self.assertEqual(package_version["date"], "2015-10-13")
55- self.assertEqual(package_version["developer"], "ubuntu")
56+ self.assertEqual(package_version["name"], "core")
57+ self.assertEqual(package_version["version"], "16.04.1")
58+ self.assertEqual(package_version["install-date"], "2016-12-05T16:07:14+01:00")
59+ self.assertEqual(package_version["developer"], "canonical")
60+ self.assertEqual(package_version["confinement"], "strict")
61+ self.assertEqual(package_version["revision"], "620")
62+ self.assertEqual(package_version["channel"], "edge")
63
64 def test_package_modaliases(self):
65 """

Subscribers

People subscribed via source and target branches