You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: commit0/cli.py
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@
14
14
importsubprocess
15
15
importyaml
16
16
importos
17
-
17
+
importsys
18
18
commit0_app=typer.Typer(
19
19
no_args_is_help=True,
20
20
add_completion=False,
@@ -209,7 +209,7 @@ def test(
209
209
..., help="Directory of the repository to test"
210
210
),
211
211
test_ids: str=typer.Argument(
212
-
...,
212
+
None,
213
213
help='All ways pytest supports to run and select tests. Please provide a single string. Example: "test_mod.py", "testing/", "test_mod.py::test_func", "-k \'MyClass and not method\'"',
214
214
),
215
215
branch: Union[str, None] =typer.Option(
@@ -238,6 +238,7 @@ def test(
238
238
help="Set this to 2 for more logging information",
239
239
count=True,
240
240
),
241
+
stdin: bool=typer.Option(False, "--stdin", help="Read test names from stdin"),
241
242
) ->None:
242
243
"""Run tests on a Commit0 repository."""
243
244
check_commit0_path()
@@ -255,6 +256,13 @@ def test(
255
256
)
256
257
branch=get_active_branch(git_path)
257
258
259
+
ifstdin:
260
+
# Read test names from stdin
261
+
test_ids=sys.stdin.read().strip()
262
+
eliftest_idsisNone:
263
+
typer.echo("Error: test_ids must be provided or use --stdin option", err=True)
264
+
raisetyper.Exit(code=1)
265
+
258
266
ifverbose==2:
259
267
typer.echo(f"Running tests for repository: {repo_or_repo_path}")
0 commit comments