diff mbox series

[pynfs,3/3] server: Add test code to JSON and XML output

Message ID 20210524144251.30196-3-pvorel@suse.cz (mailing list archive)
State New
Headers show
Series [pynfs,1/3] remove trailing whitespace | expand

Commit Message

Petr Vorel May 24, 2021, 2:42 p.m. UTC
test code is printed when parsed --outfile log with showresults.py.

It's useful to have it in JSON and XML log generated by testserver.py
--json or --xml.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 nfs4.1/testmod.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/nfs4.1/testmod.py b/nfs4.1/testmod.py
index 4b4ed24..47016dd 100644
--- a/nfs4.1/testmod.py
+++ b/nfs4.1/testmod.py
@@ -481,6 +481,7 @@  def json_printresults(tests, file_name, suite='all'):
         data["testcase"] = []
         for t in tests:
             test = {
+                "code": t.code,
                 "name": t.name,
                 "classname": t.suite,
                 "time": str(t.time_taken),
@@ -520,6 +521,7 @@  def xml_printresults(tests, file_name, suite='all'):
         for t in tests:
             testcase = doc.createElement("testcase")
             testsuite.appendChild(testcase)
+            testcase.setAttribute("code", t.code)
             testcase.setAttribute("name", t.name)
             testcase.setAttribute("classname", t.suite)
             testcase.setAttribute("time", t.time_taken)