Skip to content

Commit

Permalink
Raise error when the workdir of runs doesn't exist (#2805)
Browse files Browse the repository at this point in the history
Co-authored-by: Petr Šplíchal <psplicha@redhat.com>
  • Loading branch information
skycastlelily and psss authored Jan 9, 2025
1 parent 9cc6692 commit f558779
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit f558779

Please sign in to comment.