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
=== modified file 'checkbox-ng/checkbox_ng/launcher.py'
--- checkbox-ng/checkbox_ng/launcher.py 2016-03-14 21:04:19 +0000
+++ checkbox-ng/checkbox_ng/launcher.py 2016-03-22 16:27:30 +0000
@@ -26,6 +26,7 @@
26import logging26import logging
2727
28from checkbox_ng.config import SECURE_ID_PATTERN28from checkbox_ng.config import SECURE_ID_PATTERN
29from plainbox.impl.applogic import PlainBoxConfig
29from plainbox.impl.secure import config30from plainbox.impl.secure import config
30from plainbox.impl.session.assistant import get_all_sa_flags31from plainbox.impl.session.assistant import get_all_sa_flags
31from plainbox.impl.session.assistant import get_known_sa_api_versions32from plainbox.impl.session.assistant import get_known_sa_api_versions
@@ -35,7 +36,7 @@
35logger = logging.getLogger("checkbox.ng.launcher")36logger = logging.getLogger("checkbox.ng.launcher")
3637
3738
38class LauncherDefinition(config.Config):39class LauncherDefinition(PlainBoxConfig):
39 """40 """
40 Launcher definition.41 Launcher definition.
4142
@@ -270,5 +271,8 @@
270 name='transport',271 name='transport',
271 help_text=_('Transport declaration'))272 help_text=_('Transport declaration'))
272273
274 environment = config.Section(
275 help_text=_('Environment variables to use'))
276
273277
274DefaultLauncherDefinition = LauncherDefinition1278DefaultLauncherDefinition = LauncherDefinition1
275279
=== modified file 'checkbox-ng/docs/launcher-tutorial.rst'
--- checkbox-ng/docs/launcher-tutorial.rst 2016-03-15 11:53:25 +0000
+++ checkbox-ng/docs/launcher-tutorial.rst 2016-03-22 16:27:30 +0000
@@ -186,6 +186,23 @@
186strategies are ``XDG`` and ``Snappy``. By default the best strategy is186strategies are ``XDG`` and ``Snappy``. By default the best strategy is
187determined in runtime.187determined in runtime.
188188
189Environment section
190===================
191
192``[environment]``
193
194Beginning of the environment section
195
196Each variable present in the ``environment`` section will be present as
197environment variable for all jobs run.
198
199Example:
200
201::
202
203 [environment]
204 TESTING_HOST = 192.168.0.100
205
189206
190Generating reports207Generating reports
191==================208==================
192209
=== modified file 'checkbox-ng/launchers/checkbox-cli'
--- checkbox-ng/launchers/checkbox-cli 2016-03-15 13:42:18 +0000
+++ checkbox-ng/launchers/checkbox-cli 2016-03-22 16:27:30 +0000
@@ -202,6 +202,7 @@
202 self.ctx = ctx202 self.ctx = ctx
203 self._configure_restart(ctx)203 self._configure_restart(ctx)
204 self._prepare_transports()204 self._prepare_transports()
205 ctx.sa.use_alternate_configuration(self.launcher)
205 ctx.sa.select_providers(*self.launcher.providers)206 ctx.sa.select_providers(*self.launcher.providers)
206 self._maybe_resume_session() or self._start_new_session()207 self._maybe_resume_session() or self._start_new_session()
207 self._pick_jobs_to_run()208 self._pick_jobs_to_run()

Subscribers

People subscribed via source and target branches