Merge lp:~kissiel/checkbox/fixes-confinement into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 4317
Merged at revision: 4314
Proposed branch: lp:~kissiel/checkbox/fixes-confinement
Merge into: lp:checkbox
Diff against target: 105 lines (+40/-5)
3 files modified
checkbox-touch/build-me (+15/-0)
checkbox-touch/manifest.json (+7/-3)
checkbox-touch/py/checkbox_touch.py (+18/-2)
To merge this branch: bzr merge lp:~kissiel/checkbox/fixes-confinement
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+292264@code.launchpad.net

Description of the change

This MR fixes confined jobs.

In addition it also brings version string checking when running build-me, so the problem can be avoided in the future.

Details in commit messages.

30d0bac checkbox-touch: add fake pyotherside to let importing of checkbox_touch.py
2868b5d checkbox-touch: correct version string in manifest.json
bd310da checkbox-touch: add version match checks to build-me
6e66010 checkbox-touch: change formatting in manifest.json

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Good catch with the version mismatch. thanks (and +1 for the check in build-me)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'checkbox-touch/build-me'
--- checkbox-touch/build-me 2015-11-25 11:37:14 +0000
+++ checkbox-touch/build-me 2016-04-19 12:29:16 +0000
@@ -11,7 +11,9 @@
11import textwrap11import textwrap
1212
13from confinement.generate import generate_confinement13from confinement.generate import generate_confinement
14sys.path.append('./py')
14from py.embedded_providers import EmbeddedProvider1PlugInCollection15from py.embedded_providers import EmbeddedProvider1PlugInCollection
16from py.checkbox_touch import CheckboxTouchApplication
1517
16# DEFAULT_PROVIDERS is a list of providers directory names as listed in18# DEFAULT_PROVIDERS is a list of providers directory names as listed in
17# ../providers. NOTE: those are directory names, not provider names as reported19# ../providers. NOTE: those are directory names, not provider names as reported
@@ -59,6 +61,18 @@
59 "{} not found!\nHave you run get-libs?".format(path))61 "{} not found!\nHave you run get-libs?".format(path))
6062
6163
64def check_versions_match(manifest):
65 """Check if version coded in python matches one from manifest.json."""
66 res = CheckboxTouchApplication().get_version_pair()
67 version_from_py = res['result']['application_version']
68
69 if manifest['version'] != version_from_py:
70 raise Exception(
71 ("Version mismatch! Version from checkbox_touch.py: {}, "
72 "version from manifest.json: {}").format(
73 version_from_py, manifest['version']))
74
75
62def get_revision_string(path='.'):76def get_revision_string(path='.'):
63 # Try getting revno from bazaar vcs77 # Try getting revno from bazaar vcs
64 try:78 try:
@@ -140,6 +154,7 @@
140 sys.exit('Provider validation failed.')154 sys.exit('Provider validation failed.')
141155
142 current_manifest = json.loads(open('manifest.json', 'rt').read())156 current_manifest = json.loads(open('manifest.json', 'rt').read())
157 check_versions_match(current_manifest)
143 hooks = {158 hooks = {
144 'checkbox-touch': current_manifest['hooks']['checkbox-touch']159 'checkbox-touch': current_manifest['hooks']['checkbox-touch']
145 }160 }
146161
=== modified file 'checkbox-touch/manifest.json'
--- checkbox-touch/manifest.json 2016-04-19 06:28:06 +0000
+++ checkbox-touch/manifest.json 2016-04-19 12:29:16 +0000
@@ -1,5 +1,9 @@
1{1{
2 "architecture": ["armhf", "i386", "amd64"],2 "architecture": [
3 "armhf",
4 "i386",
5 "amd64"
6 ],
3 "description": "System testing utility for Ubuntu",7 "description": "System testing utility for Ubuntu",
4 "framework": "ubuntu-sdk-14.10",8 "framework": "ubuntu-sdk-14.10",
5 "hooks": {9 "hooks": {
@@ -11,9 +15,9 @@
11 "maintainer": "Zygmunt Krynicki <zkrynicki@ubuntu.com>",15 "maintainer": "Zygmunt Krynicki <zkrynicki@ubuntu.com>",
12 "name": "com.ubuntu.checkbox",16 "name": "com.ubuntu.checkbox",
13 "title": "Checkbox",17 "title": "Checkbox",
14 "version": "1.3.dev0",18 "version": "1.3.dev",
15 "x-source": {19 "x-source": {
16 "vcs-bzr": "lp:checkbox",20 "vcs-bzr": "lp:checkbox",
17 "vcs-bzr-revno": "checkbox-touch-v1.3.dev0"21 "vcs-bzr-revno": "checkbox-touch-v1.3.dev0"
18 }22 }
19}23}
20\ No newline at end of file24\ No newline at end of file
2125
=== modified file 'checkbox-touch/py/checkbox_touch.py'
--- checkbox-touch/py/checkbox_touch.py 2016-02-17 09:31:44 +0000
+++ checkbox-touch/py/checkbox_touch.py 2016-04-19 12:29:16 +0000
@@ -1,6 +1,6 @@
1# This file is part of Checkbox.1# This file is part of Checkbox.
2#2#
3# Copyright 2014-2015 Canonical Ltd.3# Copyright 2014-2016 Canonical Ltd.
4# Written by:4# Written by:
5# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>5# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
6# Maciej Kisielewski <maciej.kisielewski@canonical.com>6# Maciej Kisielewski <maciej.kisielewski@canonical.com>
@@ -35,7 +35,23 @@
35import json35import json
36import logging36import logging
37import os37import os
38import pyotherside38try:
39 import pyotherside
40except ImportError:
41 class FakePyOtherSide():
42 """
43 Bogus pyotherside that does nothing.
44
45 CheckboxTouchUI uses pyotherside to propagate the output of running
46 job's command to the QML side.
47
48 pyotherside module is only available when python is run by PyOtherSide;
49 If this module is imported elsewhere (e.g. tests, packaging, etc.),
50 this bogus class is used instead.
51 """
52 def send(self, event, *args):
53 pass
54 pyotherside = FakePyOtherSide()
39import sqlite355import sqlite3
40import re56import re
41import time57import time

Subscribers

People subscribed via source and target branches