From cf2abccde889e4530469f82e15289262ec1c782b Mon Sep 17 00:00:00 2001 From: Willi Goesgens Date: Tue, 13 Jan 2015 19:05:48 +0100 Subject: [PATCH] Fix output of empty xml files if there was a skipped test - return the propper message if the test is skipped - evaluate skipped in the xml dumper - ignore status fields in the structure as test results for xmls --- js/server/modules/org/arangodb/testing.js | 9 +++++++-- scripts/unittest.js | 14 +++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/js/server/modules/org/arangodb/testing.js b/js/server/modules/org/arangodb/testing.js index 4d42ad76f2..d6a4ebe6bf 100644 --- a/js/server/modules/org/arangodb/testing.js +++ b/js/server/modules/org/arangodb/testing.js @@ -1129,8 +1129,13 @@ var impTodo = [ testFuncs.importing = function (options) { if (options.cluster) { print("Skipped because of cluster."); - return {"importing": {"status":true, "skipped":true, - "message": "skipped because of cluster"}}; + return {"importing": + { + "status" : true, + "message": "skipped because of cluster", + "skipped": true + } + }; } var instanceInfo = startInstance("tcp", options, [ ], "importing"); diff --git a/scripts/unittest.js b/scripts/unittest.js index 16252f9625..82a474184a 100644 --- a/scripts/unittest.js +++ b/scripts/unittest.js @@ -46,14 +46,22 @@ function resultsToXml(results, baseName) { } for (var testrun in results) { - if (results.hasOwnProperty(testrun)) { + if ((testrun !== "all_ok") && (results.hasOwnProperty(testrun))) { for (var test in results[testrun]) { - if (results[testrun].hasOwnProperty(test)) { + + if ((test !== "ok") && + results[testrun].hasOwnProperty(test) && + !results[testrun][test].hasOwnProperty('skipped')) { + var xml = buildXml(); + var failuresFound = ""; + if (results[testrun][test].hasOwnProperty('failed')) { + failuresFound = results[testrun][test].failed; + } xml.elem("testsuite", { errors: 0, - failures: results[testrun][test].failed, + failures: failuresFound, name: test, tests: results[testrun][test].total, time: results[testrun][test].duration