Merge lp:~kissiel/checkbox/move-launcher-to-pbox into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: 4443
Merged at revision: 4446
Proposed branch: lp:~kissiel/checkbox/move-launcher-to-pbox
Merge into: lp:checkbox
Diff against target: 214 lines (+25/-35)
9 files modified
checkbox-ng/checkbox_ng/certification.py (+2/-10)
checkbox-ng/checkbox_ng/commands/launcher.py (+1/-1)
checkbox-ng/checkbox_ng/commands/submit.py (+1/-1)
checkbox-ng/checkbox_ng/config.py (+1/-3)
checkbox-ng/checkbox_ng/test_certification.py (+1/-1)
checkbox-ng/launchers/checkbox-cli (+8/-8)
checkbox-touch/py/checkbox_touch.py (+1/-1)
plainbox/plainbox/impl/launcher.py (+5/-5)
plainbox/plainbox/impl/test_launcher.py (+5/-5)
To merge this branch: bzr merge lp:~kissiel/checkbox/move-launcher-to-pbox
Reviewer Review Type Date Requested Status
Sylvain Pineau Approve
Review via email: mp+300315@code.launchpad.net

Description of the change

This MR moves launcher definitions to plainbox (from checkbox-ng)

This is a first step to get launchers working on Ubuntu Touch Device - we don't want to pull checkbox-ng to the device. Other reasoning includes:

1) Launchers are designed to be shared between different *box front-ends. So
having them defined in checkbox-ng means any other front-end wanting to use
launchers would have to depend on checkbox-ng.
2) There is nothing in launchers that's related to checkbox-ng.
3) Launchers are kinds of PlainboxConfigs

0bda82c checkbox-ng: use SECURE_ID_PATTERN from plainbox
fc3c845 move launcher-related classes to plainbox
9be32d9 checkbox-ng:checkbox-cli: sort imports

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

Juts one question, see below.

Revision history for this message
Maciej Kisielewski (kissiel) :
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Thanks for the InvalidSecureIDError removal. +1 for this move (indeed pulling checkbox-ng just to have launcher config was not ideal)

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

The attempt to merge lp:~kissiel/checkbox/move-launcher-to-pbox into lp:checkbox failed. Below is the output from the failed tests.

[precise] starting container
[precise] (timing) 0.09user 0.09system 0:04.36elapsed 4%CPU (0avgtext+0avgdata 10248maxresident)k
[precise] (timing) 0inputs+32outputs (0major+8257minor)pagefaults 0swaps
[precise] provisioning container
[precise] (timing) 44.92user 18.35system 1:11.70elapsed 88%CPU (0avgtext+0avgdata 96728maxresident)k
[precise] (timing) 0inputs+19072outputs (0major+3198955minor)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: FAIL
[precise-testing] stdout: http://paste.ubuntu.com/20159496/
[precise-testing] stderr: http://paste.ubuntu.com/20159497/
[precise-testing] (timing) Command exited with non-zero status 1
[precise-testing] (timing) 0.69user 0.12system 0:00.86elapsed 96%CPU (0avgtext+0avgdata 48232maxresident)k
[precise-testing] (timing) 0inputs+1368outputs (0major+21977minor)pagefaults 0swaps
Found a test script: ./checkbox-support/requirements/container-tests-checkbox-support
[precise-testing] container-tests-checkbox-support: PASS
[precise-testing] (timing) 30.02user 0.24system 0:30.31elapsed 99%CPU (0avgtext+0avgdata 150668maxresident)k
[precise-testing] (timing) 0inputs+1376outputs (0major+39233minor)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.00user 0.01system 0:00.02elapsed 72%CPU (0avgtext+0avgdata 2184maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+2373minor)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.04user 0.10system 0:01.16elapsed 98%CPU (0avgtext+0avgdata 46624maxresident)k
[precise-testing] (timing) 0inputs+64outputs (0major+14294minor)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.23user 0.05system 0:00.29elapsed 96%CPU (0avgtext+0avgdata 14564maxresident)k
[precise-testing] (timing) 0inputs+88outputs (0major+6074minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox
[precise-testing] container-tests-plainbox: PASS
[precise-testing] (timing) 52.52user 1.56system 0:54.24elapsed 99%CPU (0avgtext+0avgdata 201068maxresident)k
[precise-testing] (timing) 0inputs+3304outputs (0major+261455minor)pagefaults 0swaps
Found a test script: ./plainbox/requirements/container-tests-plainbox-documentation
[precise-testing] container-tests-plainbox-documentation: PASS
[precise-testing] (timing) 146.54user 0.58system 2:27.43elapsed 99%CPU (0avgtext+0avgdata 184104maxresident)k
[precise-testing] (timing) 0inputs+43208outputs (0major+58191minor)pagefaul...

4443. By Maciej Kisielewski

checkbox-ng: remove InvalidSecureIDError from checkbox-ng

And use the one from plainbox.

Signed-off-by: Maciej Kisielewski <email address hidden>

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

Tarmac failed because of the missing import.
Added the magic line and retested.
Self-approving.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-ng/checkbox_ng/certification.py'
2--- checkbox-ng/checkbox_ng/certification.py 2016-02-17 10:14:38 +0000
3+++ checkbox-ng/checkbox_ng/certification.py 2016-07-21 08:52:09 +0000
4@@ -31,24 +31,16 @@
5 import re
6
7 from plainbox.impl.secure.config import Unset
8+from plainbox.impl.transport import InvalidSecureIDError
9+from plainbox.impl.transport import SECURE_ID_PATTERN
10 from plainbox.impl.transport import TransportBase
11 from plainbox.impl.transport import TransportError
12 import requests
13
14-from checkbox_ng.config import SECURE_ID_PATTERN
15-
16
17 logger = getLogger("checkbox.ng.certification")
18
19
20-class InvalidSecureIDError(ValueError):
21- def __init__(self, value):
22- self.value = value
23-
24- def __str__(self):
25- return repr(self.value)
26-
27-
28 class CertificationTransport(TransportBase):
29 """
30 Transport for sending data to certification database.
31
32=== modified file 'checkbox-ng/checkbox_ng/commands/launcher.py'
33--- checkbox-ng/checkbox_ng/commands/launcher.py 2016-03-01 09:41:13 +0000
34+++ checkbox-ng/checkbox_ng/commands/launcher.py 2016-07-21 08:52:09 +0000
35@@ -32,9 +32,9 @@
36 from checkbox_ng.commands.newcli import CliInvocation2
37 from checkbox_ng.commands.submit import SubmitCommand
38 from checkbox_ng.config import CheckBoxConfig
39-from checkbox_ng.launcher import LauncherDefinition
40
41 from plainbox.impl.commands.cmd_checkbox import CheckBoxCommandMixIn
42+from plainbox.impl.launcher import LauncherDefinition
43
44 logger = logging.getLogger("checkbox.ng.commands.launcher")
45
46
47=== modified file 'checkbox-ng/checkbox_ng/commands/submit.py'
48--- checkbox-ng/checkbox_ng/commands/submit.py 2015-06-10 14:48:45 +0000
49+++ checkbox-ng/checkbox_ng/commands/submit.py 2016-07-21 08:52:09 +0000
50@@ -34,9 +34,9 @@
51 from plainbox.impl.commands import PlainBoxCommand
52 from plainbox.impl.secure.config import Unset
53 from plainbox.impl.transport import TransportError
54+from plainbox.impl.transport import SECURE_ID_PATTERN
55
56 from checkbox_ng.certification import CertificationTransport
57-from checkbox_ng.config import SECURE_ID_PATTERN
58
59
60 class SubmitInvocation:
61
62=== modified file 'checkbox-ng/checkbox_ng/config.py'
63--- checkbox-ng/checkbox_ng/config.py 2015-09-04 09:38:01 +0000
64+++ checkbox-ng/checkbox_ng/config.py 2016-07-21 08:52:09 +0000
65@@ -28,9 +28,7 @@
66
67 from plainbox.impl.applogic import PlainBoxConfig
68 from plainbox.impl.secure import config
69-
70-
71-SECURE_ID_PATTERN = r"^[a-zA-Z0-9]{15}$|^[a-zA-Z0-9]{18}$"
72+from plainbox.impl.transport import SECURE_ID_PATTERN
73
74
75 class CheckBoxConfig(PlainBoxConfig):
76
77=== modified file 'checkbox-ng/checkbox_ng/test_certification.py'
78--- checkbox-ng/checkbox_ng/test_certification.py 2015-06-10 15:14:06 +0000
79+++ checkbox-ng/checkbox_ng/test_certification.py 2016-07-21 08:52:09 +0000
80@@ -30,6 +30,7 @@
81
82 from pkg_resources import resource_string
83 from plainbox.impl.applogic import PlainBoxConfig
84+from plainbox.impl.transport import InvalidSecureIDError
85 from plainbox.impl.transport import TransportError
86 from plainbox.vendor import mock
87 from plainbox.vendor.mock import MagicMock
88@@ -37,7 +38,6 @@
89 import requests
90
91 from checkbox_ng.certification import CertificationTransport
92-from checkbox_ng.certification import InvalidSecureIDError
93
94
95 class CertificationTransportTests(TestCase):
96
97=== modified file 'checkbox-ng/launchers/checkbox-cli'
98--- checkbox-ng/launchers/checkbox-cli 2016-06-03 10:14:48 +0000
99+++ checkbox-ng/launchers/checkbox-cli 2016-07-21 08:52:09 +0000
100@@ -39,31 +39,31 @@
101 from guacamole.ingredients import cmdtree
102 from guacamole.recipes.cmd import CommandRecipe
103
104-from checkbox_ng.certification import InvalidSecureIDError
105-from checkbox_ng.launcher import DefaultLauncherDefinition
106-from checkbox_ng.launcher import LauncherDefinition
107 from plainbox.abc import IJobResult
108 from plainbox.i18n import ngettext
109 from plainbox.i18n import pgettext as C_
110+from plainbox.impl.color import Colorizer
111 from plainbox.impl.commands.inv_run import Action
112 from plainbox.impl.commands.inv_run import ActionUI
113 from plainbox.impl.commands.inv_run import NormalUI
114 from plainbox.impl.commands.inv_run import ReRunJob
115 from plainbox.impl.commands.inv_run import seconds_to_human_duration
116-from plainbox.impl.color import Colorizer
117 from plainbox.impl.ingredients import CanonicalCrashIngredient
118 from plainbox.impl.ingredients import RenderingContextIngredient
119 from plainbox.impl.ingredients import SessionAssistantIngredient
120-from plainbox.impl.result import tr_outcome
121+from plainbox.impl.launcher import DefaultLauncherDefinition
122+from plainbox.impl.launcher import LauncherDefinition
123 from plainbox.impl.result import JobResultBuilder
124 from plainbox.impl.result import MemoryJobResult
125-from plainbox.vendor.textland import get_display
126+from plainbox.impl.result import tr_outcome
127 from plainbox.impl.session.assistant import SA_RESTARTABLE
128 from plainbox.impl.session.jobs import InhibitionCause
129+from plainbox.impl.session.restart import detect_restart_strategy
130 from plainbox.impl.session.restart import get_strategy_by_name
131-from plainbox.impl.session.restart import detect_restart_strategy
132+from plainbox.impl.transport import TransportError
133+from plainbox.impl.transport import InvalidSecureIDError
134 from plainbox.impl.transport import get_all_transports
135-from plainbox.impl.transport import TransportError
136+from plainbox.vendor.textland import get_display
137
138 from checkbox_ng.misc import SelectableJobTreeNode
139 from checkbox_ng.ui import ScrollableTreeNode
140
141=== modified file 'checkbox-touch/py/checkbox_touch.py'
142--- checkbox-touch/py/checkbox_touch.py 2016-07-12 21:09:34 +0000
143+++ checkbox-touch/py/checkbox_touch.py 2016-07-21 08:52:09 +0000
144@@ -181,7 +181,7 @@
145 self.assistant.use_alternate_execution_controllers(ctrl_setup_list)
146
147 if launcher_definition:
148- from checkbox_ng.launcher import LauncherDefinition
149+ from plainbox.impl.launcher import LauncherDefinition
150 generic_launcher = LauncherDefinition()
151 generic_launcher.read([launcher_definition])
152 config_filename = os.path.expandvars(
153
154=== renamed file 'checkbox-ng/checkbox_ng/launcher.py' => 'plainbox/plainbox/impl/launcher.py'
155--- checkbox-ng/checkbox_ng/launcher.py 2016-05-26 18:38:57 +0000
156+++ plainbox/plainbox/impl/launcher.py 2016-07-21 08:52:09 +0000
157@@ -18,22 +18,22 @@
158 # along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
159
160 """
161-:mod:`checkbox_ng.launcher` -- launcher definition
162+:mod:`plainbox.impl.launcher` -- launcher definition
163 ==================================================
164 """
165
166 from gettext import gettext as _
167 import logging
168
169-from checkbox_ng.config import SECURE_ID_PATTERN
170 from plainbox.impl.applogic import PlainBoxConfig
171 from plainbox.impl.secure import config
172 from plainbox.impl.session.assistant import get_all_sa_flags
173 from plainbox.impl.session.assistant import get_known_sa_api_versions
174 from plainbox.impl.transport import get_all_transports
175-
176-
177-logger = logging.getLogger("checkbox.ng.launcher")
178+from plainbox.impl.transport import SECURE_ID_PATTERN
179+
180+
181+logger = logging.getLogger("plainbox.launcher")
182
183
184 class LauncherDefinition(PlainBoxConfig):
185
186=== renamed file 'checkbox-ng/checkbox_ng/test_launcher.py' => 'plainbox/plainbox/impl/test_launcher.py'
187--- checkbox-ng/checkbox_ng/test_launcher.py 2016-03-01 09:41:13 +0000
188+++ plainbox/plainbox/impl/test_launcher.py 2016-07-21 08:52:09 +0000
189@@ -17,10 +17,10 @@
190 # along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
191
192 """
193-checkbox_ng.test_launcher
194+plainbox.impl.test_launcher
195 =========================
196
197-Test definitions for checkbox_ng.launcher module
198+Test definitions for plainbox.imlp.launcher module
199 """
200
201 from unittest import TestCase
202@@ -28,9 +28,9 @@
203
204 from plainbox.impl.secure.config import Unset
205
206-from launcher import LauncherDefinition
207-from launcher import LauncherDefinitionLegacy
208-from launcher import LauncherDefinition1
209+from plainbox.impl.launcher import LauncherDefinition
210+from plainbox.impl.launcher import LauncherDefinitionLegacy
211+from plainbox.impl.launcher import LauncherDefinition1
212
213
214 class LauncherDefinitionTests(TestCase):

Subscribers

People subscribed via source and target branches