Skip to content

Commit 8edc91f

Browse files
committed
fix: raise exception for invalid test session id
1 parent c54332b commit 8edc91f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

smart_tests/commands/helper.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@ def parse_session(session_id: str) -> Tuple[str, str]:
4646
4747
Returns:
4848
Tuple of (build_name, test_session_id)
49+
50+
Raises:
51+
ValueError: If session_id format is invalid
4952
"""
5053
import re
5154
match = re.match(r"builds/([^/]+)/test_sessions/(.+)", session_id)
5255
if match:
5356
return match.group(1), match.group(2)
5457
else:
55-
# Fallback for unexpected format
56-
return "unknown", session_id
58+
raise ValueError(
59+
f"Invalid session ID format: {session_id}. Expected format: builds/{{build_name}}/test_sessions/{{test_session_id}}")
5760

5861

5962
def _check_observation_mode_status(session: str, is_observation: bool,

0 commit comments

Comments
 (0)