diff options
author | Vadim Rutkovsky <vrutkovs@redhat.com> | 2014-04-29 19:43:58 +0800 |
---|---|---|
committer | Vadim Rutkovsky <vrutkovs@redhat.com> | 2014-04-29 19:43:58 +0800 |
commit | 1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5 (patch) | |
tree | 3f7b36925e99543fec22422e322b31fcfa7d5028 /tests | |
parent | 6f9be3d2f01f3865fa8ea6f5de5189d6ee102952 (diff) | |
download | gsoc2013-evolution-1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5.tar gsoc2013-evolution-1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5.tar.gz gsoc2013-evolution-1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5.tar.bz2 gsoc2013-evolution-1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5.tar.lz gsoc2013-evolution-1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5.tar.xz gsoc2013-evolution-1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5.tar.zst gsoc2013-evolution-1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5.zip |
tests: attach journald logs to html report
Diffstat (limited to 'tests')
-rw-r--r-- | tests/environment.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/environment.py b/tests/environment.py index a9098e6904..0a8dc5c74c 100644 --- a/tests/environment.py +++ b/tests/environment.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- -from time import sleep +from time import sleep, localtime, strftime from dogtail.utils import isA11yEnabled, enableA11y if not isA11yEnabled(): enableA11y(True) @@ -29,6 +29,9 @@ def before_all(context): # Cleanup existing data before any test cleanup() + # Store scenario start time for session logs + context.log_start_time = strftime("%Y-%m-%d %H:%M:%S", localtime()) + context.app_class = App('evolution') except Exception as e: @@ -57,6 +60,13 @@ def after_scenario(context, scenario): # Stop evolution context.app_class.kill() + # Attach journalctl logs + if hasattr(context, "embed"): + os.system("journalctl /usr/bin/gnome-session --no-pager -o cat --since='%s'> /tmp/journal-session.log" % context.log_start_time) + data = open("/tmp/journal-session.log", 'r').read() + if data: + context.embed('text/plain', data) + # Make some pause after scenario sleep(1) except Exception as e: |