Skip to content

Commit

Permalink
webui: tests: don't apply step_logger decorator for non permian tests
Browse files Browse the repository at this point in the history
The latter introduces quite some noice and the log view for cockpit
tests does not nicely integrate with the extra screenshots.
  • Loading branch information
KKoukiou committed Jun 19, 2023
1 parent 8484637 commit fe0192b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/webui/test/helpers/permian.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions ui/webui/test/helpers/step_logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os

class BrowserSnapshot():
SNAPSHOT_NUMBER = 0
Expand All @@ -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:])
Expand Down

0 comments on commit fe0192b

Please sign in to comment.