Merge lp:~sylvain-pineau/checkbox/doc_and_logging_fixes into lp:checkbox

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 4389
Merged at revision: 4397
Proposed branch: lp:~sylvain-pineau/checkbox/doc_and_logging_fixes
Merge into: lp:checkbox
Diff against target: 63 lines (+12/-5)
3 files modified
checkbox-ng/docs/launcher-tutorial.rst (+5/-2)
plainbox/plainbox/impl/session/state.py (+5/-2)
plainbox/plainbox/impl/session/test_state.py (+2/-1)
To merge this branch: bzr merge lp:~sylvain-pineau/checkbox/doc_and_logging_fixes
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Paul Larson Needs Fixing
Review via email: mp+296786@code.launchpad.net

Description of the change

Two small fixes, one for checkbox launcher documentation about converged launchers.
Second is a patch to the exception msg in plainbox.session.state where the unit.id was missing to actually make that msg useful.

Tested by just duplicating a job in the checkbox provider and calling plainbox -h

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

A couple of flakes pointed out below (would like to keep it clean since I think this is one of them I went through the trouble of correcting a while back).
Otherwise looks like this will help debugging problems like this, thanks!

review: Needs Fixing
4389. By Sylvain Pineau

plainbox:session:state: Add unit ids to Exception msg

The famous "attempting to add the same unit twice"

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

Thanks Paul, falke8 was not run indeed, my bad.

Fixed and re-pushed (and self-approved)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-ng/docs/launcher-tutorial.rst'
2--- checkbox-ng/docs/launcher-tutorial.rst 2016-05-04 09:21:57 +0000
3+++ checkbox-ng/docs/launcher-tutorial.rst 2016-06-09 07:29:19 +0000
4@@ -198,8 +198,11 @@
5
6 ``type``
7
8-Type of UI to use. This has to be set to ``interactive`` or to ``silent``.
9-Default value: ``interactive``.
10+Type of UI to use. This has to be set to ``interactive``, ``silent`` or
11+``converged``.
12+Default value: ``interactive``, which runs the Checkbox command line version.
13+Note: the ``converged`` UI type will launch the QML interface and requires
14+checkbox-converged to be installed on your system.
15 Note: using ``silent`` UI type requires forcing test selection and test plan
16 selection.
17
18
19=== modified file 'plainbox/plainbox/impl/session/state.py'
20--- plainbox/plainbox/impl/session/state.py 2015-12-10 10:08:49 +0000
21+++ plainbox/plainbox/impl/session/state.py 2016-06-09 07:29:19 +0000
22@@ -390,7 +390,9 @@
23 it does so before any of the units from that provider are added.
24 """
25 if provider in self._provider_list:
26- raise ValueError(_("attempting to add the same provider twice"))
27+ raise ValueError(
28+ _("attempting to add the same provider twice: %s"
29+ % provider.name))
30 self._provider_list.append(provider)
31 self.on_provider_added(provider)
32 if add_units:
33@@ -412,7 +414,8 @@
34 This method fires the :meth:`on_unit_added()` signal
35 """
36 if unit in self._unit_list:
37- raise ValueError(_("attempting to add the same unit twice"))
38+ raise ValueError(
39+ _("attempting to add the same unit twice: %s" % unit.id))
40 self.state.add_unit(unit)
41 # NOTE: no need to fire the on_unit_added() signal because the state
42 # object and we've connected it to will fire our version.
43
44=== modified file 'plainbox/plainbox/impl/session/test_state.py'
45--- plainbox/plainbox/impl/session/test_state.py 2016-05-16 18:10:14 +0000
46+++ plainbox/plainbox/impl/session/test_state.py 2016-06-09 07:29:19 +0000
47@@ -44,6 +44,7 @@
48 from plainbox.impl.testing_utils import make_job
49 from plainbox.impl.unit.job import JobDefinition
50 from plainbox.impl.unit.unit import Unit
51+from plainbox.impl.unit.unit_with_id import UnitWithId
52 from plainbox.vendor import mock
53 from plainbox.vendor.morris import SignalTestCase
54
55@@ -800,7 +801,7 @@
56 def setUp(self):
57 self.ctx = SessionDeviceContext()
58 self.provider = mock.Mock(name='provider', spec_set=Provider1)
59- self.unit = mock.Mock(name='unit', spec_set=Unit)
60+ self.unit = mock.Mock(name='unit', spec_set=UnitWithId)
61 self.unit.provider = self.provider
62 self.provider.unit_list = [self.unit]
63 self.provider.problem_list = []

Subscribers

People subscribed via source and target branches