Skip to content

Commit 2482aa1

Browse files
committed
Test test plan selection function
Minor: use new continue session function
1 parent 763bb95 commit 2482aa1

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/tox-checkbox.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ permissions:
33
contents: read
44
on:
55
push:
6-
branches: [ main ]
76
paths:
87
- checkbox-ng/**
98
- checkbox-support/**
@@ -18,7 +17,6 @@ on:
1817
- providers/iiotg/**
1918
- .github/workflows/tox-checkbox.yaml
2019
pull_request:
21-
branches: [ main ]
2220
paths:
2321
- checkbox-ng/**
2422
- checkbox-support/**

checkbox-ng/checkbox_ng/launcher/controller.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ def quitter(msg):
332332
)
333333
)
334334
printed_reconnecting = False
335-
state = RemoteSessionStates(state)
336-
keep_running = connection_strategy[state](self, payload)
335+
keep_running = self.continue_session()
337336
except EOFError as exc:
338337
if keep_running:
339338
print("Connection lost!")

checkbox-ng/checkbox_ng/launcher/test_subcommands.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,27 @@ def test__save_manifest_non_interactive(self, mock_browser_class):
899899
{"manifest1": False, "manifest2": 7}
900900
)
901901

902+
def test__select_test_plan_and_continue_automated_ok(self):
903+
self_mock = MagicMock()
904+
905+
def get_value(*args):
906+
if args == ("test plan", "forced"):
907+
return True
908+
elif args == ("test plan", "unit"):
909+
return "test_plan_id"
910+
elif args == ("launcher", "session_desc"):
911+
return "description"
912+
raise AssertionError("Unknown config")
913+
914+
self_mock.configuration.get_value = get_value
915+
self_mock.ctx.args.launcher = None
916+
self_mock.ctx.args.message = None
917+
self_mock.sa.get_test_plans.return_value = ["test_plan_id"]
918+
919+
Launcher._select_test_plan_and_continue(self_mock)
920+
921+
self.assertTrue(self_mock.sa.select_test_plan.called)
922+
902923

903924
@patch("os.makedirs", new=MagicMock())
904925
class TestLauncherReturnCodes(TestCase):

0 commit comments

Comments
 (0)