Merge ~sylvain-pineau/checkbox-ng:fix-manifest-test-selection-forced into checkbox-ng:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: d8efa41accaa02da12926d7feee31111288cd1c1
Merged at revision: 73e101c5226e772f162eab951d9669474173c7b2
Proposed branch: ~sylvain-pineau/checkbox-ng:fix-manifest-test-selection-forced
Merge into: checkbox-ng:master
Diff against target: 42 lines (+10/-2)
2 files modified
checkbox_ng/launcher/master.py (+5/-1)
checkbox_ng/launcher/subcommands.py (+5/-1)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+379209@code.launchpad.net

Description of the change

Fix manifest json representation when test selection is forced to avoid recording to json string value (e.g "True") instead of true.

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

Thanks. This looks to fix the scenario I had been testing with for both local and remote invocations.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_ng/launcher/master.py b/checkbox_ng/launcher/master.py
2index 2107fbf..fd14a54 100644
3--- a/checkbox_ng/launcher/master.py
4+++ b/checkbox_ng/launcher/master.py
5@@ -285,11 +285,15 @@ class RemoteMaster(ReportsStage, MainLoopStage):
6 self._is_bootstrapping = False
7 self.jobs = self.sa.finish_bootstrap()
8
9+ def _strtobool(self, val):
10+ return val.lower() in ('y', 'yes', 't', 'true', 'on', '1')
11+
12 def select_jobs(self, all_jobs):
13 if self.launcher.test_selection_forced:
14 if self.launcher.manifest is not Unset:
15 self.sa.save_manifest(
16- {manifest_id: self.launcher.manifest[manifest_id] for
17+ {manifest_id:
18+ self._strtobool(self.launcher.manifest[manifest_id]) for
19 manifest_id in self.launcher.manifest}
20 )
21 else:
22diff --git a/checkbox_ng/launcher/subcommands.py b/checkbox_ng/launcher/subcommands.py
23index 7427522..0432cdb 100644
24--- a/checkbox_ng/launcher/subcommands.py
25+++ b/checkbox_ng/launcher/subcommands.py
26@@ -400,11 +400,15 @@ class Launcher(MainLoopStage, ReportsStage):
27 self.launcher.test_plan_default_selection).run()
28 return selected_tp
29
30+ def _strtobool(self, val):
31+ return val.lower() in ('y', 'yes', 't', 'true', 'on', '1')
32+
33 def _pick_jobs_to_run(self):
34 if self.launcher.test_selection_forced:
35 if self.launcher.manifest is not Unset:
36 self.ctx.sa.save_manifest(
37- {manifest_id: self.launcher.manifest[manifest_id] for
38+ {manifest_id:
39+ self._strtobool(self.launcher.manifest[manifest_id]) for
40 manifest_id in self.launcher.manifest}
41 )
42 # by default all tests are selected; so we're done here

Subscribers

People subscribed via source and target branches