Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise error when the workdir of runs doesn't exist #2805

Merged
merged 3 commits into from
Jan 9, 2025
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
2 changes: 1 addition & 1 deletion tests/status/base/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rlJournalStart
rlLog "There should be the heading and one run"
rlAssertGrep "2" "lines"

rlRun "tmt status -i /not/a/valid/runid | tee output" 0 "Invalid ID"
rlRun "tmt status -i /not/a/valid/runid | tee output" 2 "Invalid ID"
rlRun "wc -l output | tee lines" 0 "Get the number of lines"
rlLog "There should only be the heading"
rlAssertGrep "1" "lines"
Expand Down
3 changes: 3 additions & 0 deletions tmt/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4518,6 +4518,9 @@ def generate_runs(
run_path = Path(id_name)
if '/' not in id_name:
run_path = path / run_path
if not run_path.exists():
raise tmt.utils.GeneralError(
f"Directory '{run_path}' does not exist.")
if run_path.is_absolute() and run_path.exists():
yield run_path
else:
Expand Down
Loading