Skip to content

Commit

Permalink
Add case when no tests folder found
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismail Ibrahim Quwarah committed Dec 3, 2024
1 parent 5480a8c commit 8f946c9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tmt/steps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1962,10 +1962,13 @@ def _login(
worktree = self.parent.plan.worktree
tests = self.parent.plan.discover.tests()
test_path = tests[-1].path if tests else None

if worktree and test_path:
cwd = worktree.parent / "discover" / test_path.unrooted()
else:
try:
cwd = worktree
if worktree and test_path:
cwd = worktree.parent / "discover" / test_path.unrooted()
guest.execute(tmt.utils.ShellScript("/bin/true"),
interactive=True, cwd=cwd, env=env)
except RunError:
cwd = worktree

except tmt.utils.GeneralError:
Expand Down

0 comments on commit 8f946c9

Please sign in to comment.