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

Continue after prepare failure in tmt try #3505

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
Releases
======================

tmt-1.43.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When running ``tmt try`` failure in ``prepare`` phase drops the user
to the menu to be able to login to the machine and possibly try it again.

tmt-1.42.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
17 changes: 14 additions & 3 deletions tmt/trying.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ def action_start_test(self, plan: Plan) -> None:

plan.discover.go()
plan.provision.go()
plan.prepare.go()
try:
plan.prepare.go()
except GeneralError as error:
self.print(click.style(f"\n{error}.", fg="red"))
return
plan.execute.go()

def action_start_login(self, plan: Plan) -> None:
Expand All @@ -349,7 +353,11 @@ def action_start_login(self, plan: Plan) -> None:
self.action_start(plan)

plan.provision.go()
plan.prepare.go()
try:
plan.prepare.go()
except GeneralError as error:
self.print(click.style(f"\n{error}.", fg="red"))
return
assert plan.login is not None # Narrow type
plan.login.go(force=True)

Expand Down Expand Up @@ -446,7 +454,10 @@ def action_prepare(self, plan: Plan) -> None:
Prepare the guest
"""

plan.prepare.go(force=True)
try:
plan.prepare.go(force=True)
except GeneralError as error:
self.print(click.style(f"\n{error}.", fg="red"))

def action_execute(self, plan: Plan) -> None:
"""
Expand Down