Merge lp:~kissiel/checkbox/fix-1560198-environ-in-launchers into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 4284
Merged at revision: 4283
Proposed branch: lp:~kissiel/checkbox/fix-1560198-environ-in-launchers
Merge into: lp:checkbox
Diff against target: 69 lines (+23/-1)
3 files modified
checkbox-ng/checkbox_ng/launcher.py (+5/-1)
checkbox-ng/docs/launcher-tutorial.rst (+17/-0)
checkbox-ng/launchers/checkbox-cli (+1/-0)
To merge this branch: bzr merge lp:~kissiel/checkbox/fix-1560198-environ-in-launchers
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+289814@code.launchpad.net

Description of the change

This MR brings [environment] section to new launchers.

... and configs.

418e747 checkbox-ng:launchers: support [environment] in new launchers
c87d070 checkbox-ng:docs: mention [environment] in the docs

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

use_alternate_configuration and PlainBoxConfig, good findings, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-ng/checkbox_ng/launcher.py'
2--- checkbox-ng/checkbox_ng/launcher.py 2016-03-14 21:04:19 +0000
3+++ checkbox-ng/checkbox_ng/launcher.py 2016-03-22 16:27:30 +0000
4@@ -26,6 +26,7 @@
5 import logging
6
7 from checkbox_ng.config import SECURE_ID_PATTERN
8+from plainbox.impl.applogic import PlainBoxConfig
9 from plainbox.impl.secure import config
10 from plainbox.impl.session.assistant import get_all_sa_flags
11 from plainbox.impl.session.assistant import get_known_sa_api_versions
12@@ -35,7 +36,7 @@
13 logger = logging.getLogger("checkbox.ng.launcher")
14
15
16-class LauncherDefinition(config.Config):
17+class LauncherDefinition(PlainBoxConfig):
18 """
19 Launcher definition.
20
21@@ -270,5 +271,8 @@
22 name='transport',
23 help_text=_('Transport declaration'))
24
25+ environment = config.Section(
26+ help_text=_('Environment variables to use'))
27+
28
29 DefaultLauncherDefinition = LauncherDefinition1
30
31=== modified file 'checkbox-ng/docs/launcher-tutorial.rst'
32--- checkbox-ng/docs/launcher-tutorial.rst 2016-03-15 11:53:25 +0000
33+++ checkbox-ng/docs/launcher-tutorial.rst 2016-03-22 16:27:30 +0000
34@@ -186,6 +186,23 @@
35 strategies are ``XDG`` and ``Snappy``. By default the best strategy is
36 determined in runtime.
37
38+Environment section
39+===================
40+
41+``[environment]``
42+
43+Beginning of the environment section
44+
45+Each variable present in the ``environment`` section will be present as
46+environment variable for all jobs run.
47+
48+Example:
49+
50+::
51+
52+ [environment]
53+ TESTING_HOST = 192.168.0.100
54+
55
56 Generating reports
57 ==================
58
59=== modified file 'checkbox-ng/launchers/checkbox-cli'
60--- checkbox-ng/launchers/checkbox-cli 2016-03-15 13:42:18 +0000
61+++ checkbox-ng/launchers/checkbox-cli 2016-03-22 16:27:30 +0000
62@@ -202,6 +202,7 @@
63 self.ctx = ctx
64 self._configure_restart(ctx)
65 self._prepare_transports()
66+ ctx.sa.use_alternate_configuration(self.launcher)
67 ctx.sa.select_providers(*self.launcher.providers)
68 self._maybe_resume_session() or self._start_new_session()
69 self._pick_jobs_to_run()

Subscribers

People subscribed via source and target branches