From 80017d51a5b617736f4db18141b42f7323e17c37 Mon Sep 17 00:00:00 2001 From: Katerina Koukiou Date: Mon, 19 Jun 2023 09:54:52 +0200 Subject: [PATCH] webui: tests: don't apply step_logger decorator for non permian tests The latter introduces quite some noice and the log view for cockpit tests does not nicely integrate with the extra screenshots. --- ui/webui/test/helpers/end2end.py | 1 + ui/webui/test/helpers/step_logger.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ui/webui/test/helpers/end2end.py b/ui/webui/test/helpers/end2end.py index 64496ef95a1d..c738636a5a10 100644 --- a/ui/webui/test/helpers/end2end.py +++ b/ui/webui/test/helpers/end2end.py @@ -49,6 +49,7 @@ def setUp(self): self.logs_dir = os.path.join('./test_logs', self.__class__.__name__) if not os.path.isdir(self.logs_dir): os.makedirs(self.logs_dir) + os.environ["PERMIAN"] = True def __add_public_key(self): with open(self.machine.identity_file + '.pub', 'r') as pub: diff --git a/ui/webui/test/helpers/step_logger.py b/ui/webui/test/helpers/step_logger.py index 114a21650c67..4c66589a935b 100644 --- a/ui/webui/test/helpers/step_logger.py +++ b/ui/webui/test/helpers/step_logger.py @@ -1,3 +1,4 @@ +import os class BrowserSnapshot(): SNAPSHOT_NUMBER = 0 @@ -23,6 +24,8 @@ def log_step(snapshots=False, snapshot_before=False, snapshot_after=False, docst :type docstring: bool, optional """ def decorator(function): + if not os.environ.get('PERMIAN', False): + return function def wrapper(*args, **kwargs): nice_args = ', '.join(str(a) for a in args[1:])