Skip to content

Commit

Permalink
not get env info if reuse previous env
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Nov 15, 2024
1 parent 2962dc5 commit fe23388
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions lisa/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ def environment_information(self) -> Dict[str, Any]:
return self._environment_information

@hookspec
def update_test_result_message(self, message: TestResultMessage) -> None:
...
def update_test_result_message(self, message: TestResultMessage) -> None: ...

def handle_exception(
self, exception: Exception, log: Logger, phase: str = ""
Expand Down Expand Up @@ -290,7 +289,16 @@ def _send_result_message(self, stacktrace: Optional[str] = None) -> None:
# force refresh information, when test result status is changed. The
# refreshed information is not used so far. But in case it's needed
# in future, keep it up to date.
self._environment_information = self.environment.get_information()
force_run = True
if (
result_message.status == TestResult.status.RUNNING
and not self.environment.is_new
):
force_run = False

self._environment_information = self.environment.get_information(
force_run=force_run
)
self.information.update(self._environment_information)

self.information["environment"] = self.environment.name
Expand Down Expand Up @@ -601,11 +609,9 @@ def __init__(
self._should_stop = False
self.__log = get_logger("suite", metadata.name)

def before_case(self, log: Logger, **kwargs: Any) -> None:
...
def before_case(self, log: Logger, **kwargs: Any) -> None: ...

def after_case(self, log: Logger, **kwargs: Any) -> None:
...
def after_case(self, log: Logger, **kwargs: Any) -> None: ...

def start(
self,
Expand Down

0 comments on commit fe23388

Please sign in to comment.