Skip to content

Commit b8e91d8

Browse files
authored
Merge pull request #693 from NVIDIA/am/bug-4640855
Make --tests-dir optional
2 parents 60ccbb6 + 19b6800 commit b8e91d8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/cloudai/cli/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def common_options(f):
8585
)(f)
8686
f = click.option(
8787
"--tests-dir",
88-
required=True,
88+
required=False,
8989
type=click.Path(exists=True, resolve_path=True, path_type=Path, file_okay=False, dir_okay=True),
9090
help="Directory with Test configs.",
9191
)(f)

tests/test_cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ def test_version():
3737
assert "CloudAI, version" in result.output
3838

3939

40+
def test_tests_dir_is_optional(tmp_path: Path):
41+
system_cfg, scenario_cfg = tmp_path / "system.toml", tmp_path / "scenario.toml"
42+
system_cfg.touch()
43+
scenario_cfg.touch()
44+
runner = CliRunner()
45+
result = runner.invoke(main, ["run", "--system-config", str(system_cfg), "--test-scenario", str(scenario_cfg)])
46+
assert "Missing option '--tests-dir'" not in result.output
47+
48+
4049
@pytest.mark.parametrize(
4150
"subcommand", ["dry-run", "generate-report", "install", "list", "run", "uninstall", "verify-configs"]
4251
)

0 commit comments

Comments
 (0)