зеркало из https://github.com/microsoft/lisa.git
Runner: support notify error message
This commit is contained in:
Родитель
741767dba7
Коммит
f3af7794f8
|
@ -29,14 +29,17 @@ async def run(args: Namespace) -> int:
|
|||
|
||||
run_status = notifier.TestRunStatus.FAILED
|
||||
run_timer = create_timer()
|
||||
run_error_message = ""
|
||||
try:
|
||||
runner = RootRunner(runbook)
|
||||
await runner.start()
|
||||
run_status = notifier.TestRunStatus.SUCCESS
|
||||
except Exception as identifier:
|
||||
run_error_message = str(identifier)
|
||||
raise identifier
|
||||
finally:
|
||||
run_message = notifier.TestRunMessage(
|
||||
status=run_status,
|
||||
elapsed=run_timer.elapsed(),
|
||||
status=run_status, elapsed=run_timer.elapsed(), message=run_error_message
|
||||
)
|
||||
notifier.notify(run_message)
|
||||
notifier.finalize()
|
||||
|
|
|
@ -33,6 +33,7 @@ class TestRunMessage(MessageBase):
|
|||
test_pass: str = ""
|
||||
tags: Optional[List[str]] = None
|
||||
run_name: str = ""
|
||||
message: str = ""
|
||||
|
||||
|
||||
class Notifier(subclasses.BaseClassWithRunbookMixin, InitializableMixin):
|
||||
|
|
Загрузка…
Ссылка в новой задаче