forked from TrueCloudLab/frostfs-testlib
Implement basic version of local shell
Also added two simple reporters that can be used by the shell to report command execution details. Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
This commit is contained in:
parent
c0bbfd1705
commit
f6ee129354
11 changed files with 453 additions and 0 deletions
29
reporter/interfaces.py
Normal file
29
reporter/interfaces.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
from abc import ABC, abstractmethod
|
||||
from contextlib import AbstractContextManager
|
||||
from typing import Any
|
||||
|
||||
|
||||
class Reporter(ABC):
|
||||
"""
|
||||
Interface that supports storage of test artifacts in some reporting tool.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def step(self, name: str) -> AbstractContextManager:
|
||||
"""
|
||||
Register a new step in test execution.
|
||||
|
||||
:param str name: Name of the step
|
||||
:return: step context
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def attach(self, content: Any, file_name: str) -> None:
|
||||
"""
|
||||
Attach specified content with given file name to the test report.
|
||||
|
||||
:param any name: content to attach. If not a string, it will be converted to a string.
|
||||
:param str file_name: file name of attachment.
|
||||
"""
|
||||
pass
|
Loading…
Add table
Add a link
Reference in a new issue