[evolution] tests: attach journald logs to html report
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] tests: attach journald logs to html report
- Date: Tue, 29 Apr 2014 11:44:07 +0000 (UTC)
commit 1ed59cadaae04a119bbffcc6fcfc41f7b269c5e5
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Tue Apr 29 13:43:58 2014 +0200
tests: attach journald logs to html report
tests/environment.py | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/tests/environment.py b/tests/environment.py
index a9098e6..0a8dc5c 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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]