Merge ~sylvain-pineau/checkbox-ng:nofake-tp-export into checkbox-ng:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 3c1b472e45a0040d2aa808f6f163386f54b2eb4c
Merged at revision: 3c1b472e45a0040d2aa808f6f163386f54b2eb4c
Proposed branch: ~sylvain-pineau/checkbox-ng:nofake-tp-export
Merge into: checkbox-ng:master
Diff against target: 26 lines (+8/-3)
1 file modified
checkbox_ng/launcher/subcommands.py (+8/-3)
Reviewer Review Type Date Requested Status
Checkbox Developers Pending
Review via email: mp+361821@code.launchpad.net

Description of the change

new option to run tp export on device to get templated jobs nased on hw resources not fake resource

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

tested with and without the option.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_ng/launcher/subcommands.py b/checkbox_ng/launcher/subcommands.py
2index b5a15d0..cc4d441 100644
3--- a/checkbox_ng/launcher/subcommands.py
4+++ b/checkbox_ng/launcher/subcommands.py
5@@ -990,13 +990,18 @@ class TestPlanExport(Command):
6 parser.add_argument(
7 'TEST_PLAN',
8 help=_("test-plan id to bootstrap"))
9+ parser.add_argument(
10+ '-n', '--nofake', action='store_true')
11
12 def invoked(self, ctx):
13 self.ctx = ctx
14 try_selecting_providers(self.sa, '*')
15- from plainbox.impl.runner import FakeJobRunner
16- self.sa.start_new_session('tp-export-ephemeral', FakeJobRunner)
17- self.sa._context.state._fake_resources = True
18+ if ctx.args.nofake:
19+ self.sa.start_new_session('tp-export-ephemeral')
20+ else:
21+ from plainbox.impl.runner import FakeJobRunner
22+ self.sa.start_new_session('tp-export-ephemeral', FakeJobRunner)
23+ self.sa._context.state._fake_resources = True
24 tps = self.sa.get_test_plans()
25 if ctx.args.TEST_PLAN not in tps:
26 raise SystemExit('Test plan not found')

Subscribers

People subscribed via source and target branches