Commit 3cb39f95 authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Pavel Emelyanov

zdtm.py: add YAML block with details to a TAP report

It was requested by Andrey.

This patch adds details about failed testcase to a TAP report:

TAP version 13
1..1
not ok 1 - zdtm/static/deleted_unix_sock # flavor h
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 229a6edf
...@@ -19,6 +19,7 @@ import socket ...@@ -19,6 +19,7 @@ import socket
import fcntl import fcntl
import errno import errno
import datetime import datetime
import yaml
os.chdir(os.path.dirname(os.path.abspath(__file__))) os.chdir(os.path.dirname(os.path.abspath(__file__)))
...@@ -1086,7 +1087,9 @@ class launcher: ...@@ -1086,7 +1087,9 @@ class launcher:
failed_flavor = decode_flav(os.WEXITSTATUS(status)) failed_flavor = decode_flav(os.WEXITSTATUS(status))
if self.__file_report: if self.__file_report:
testline = "not ok %d - %s # flavor %s" % (self.__runtest, sub['name'], failed_flavor) testline = "not ok %d - %s # flavor %s" % (self.__runtest, sub['name'], failed_flavor)
details = { 'output': open(sub['log']).read() }
print >> self.__file_report, testline print >> self.__file_report, testline
print >> self.__file_report, yaml.dump(details, explicit_start=True, explicit_end=True, default_style='|')
if sub['log']: if sub['log']:
add_to_report(sub['log'], sub['name'].replace('/', '_') + "_" + failed_flavor + "/output") add_to_report(sub['log'], sub['name'].replace('/', '_') + "_" + failed_flavor + "/output")
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment