Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions smart_tests/commands/record/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@
@args4p.command(help="Record session information")
def session(
app: Application,
build_name: Annotated[str, typer.Option(
build_name: Annotated[str | None, typer.Option(
"--build",
help="Build name",
metavar="NAME",
required=True
)],
)] = None,
test_suite: Annotated[str, typer.Option(
"--test-suite",
help="Set test suite name. A test suite is a collection of test sessions. Setting a test suite allows you to "
"manage data over test sessions and lineages.",
metavar="NAME",
required=True
)],
)] = "",
flavors: Annotated[List[KeyValue], typer.Option(
"--flavor",
help="Flavors",
Expand Down
21 changes: 21 additions & 0 deletions tests/commands/record/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,24 @@ def invoke(*args):
# Invalid URL
result = invoke("--link", "GITHUB_PULL_REQUEST|PR=https://github.com/launchableinc/cli/pull/2/files")
self.assertIn("Invalid url 'https://github.com/launchableinc/cli/pull/2/files' passed to --link option", result.output)

@responses.activate
@mock.patch.dict(os.environ, {
"SMART_TESTS_TOKEN": CliTestCase.smart_tests_token,
'LANG': 'C.UTF-8',
}, clear=True)
def test_run_session_with_no_build(self):
result = self.cli(
"record", "session", "--no-build",
"--test-suite", "test-suite")
self.assert_success(result)

payload = json.loads(responses.calls[1].request.body.decode())
self.assert_json_orderless_equal({
"flavors": {},
"isObservation": False,
"links": [],
"noBuild": True,
"testSuite": "test-suite",
"timestamp": None,
}, payload)
Loading