Outputting additional information into the JUnit XML
Since it is available and seems to be desired by the JUnit spec [ http://stackoverflow.com/questions/4922867/junit-xml-format-specification-that-hudson-supports ]
This commit is contained in:
parent
8e85e593bd
commit
ef8f191c46
@ -42,16 +42,17 @@
|
||||
function(expectation)
|
||||
{
|
||||
if (!expectation.passed()) {
|
||||
failureMessages.push((failureMessages.length + 1) + ': ' + expectation.message);
|
||||
failureMessages.push(expectation.message);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
return {
|
||||
assertions: spec.results().items_.length,
|
||||
className: getNestedSuiteName(spec.suite),
|
||||
name: spec.description,
|
||||
time: spec.duration / 1000,
|
||||
failureMessage: failureMessages.join(' ')
|
||||
failureMessages: failureMessages
|
||||
};
|
||||
}
|
||||
)
|
||||
|
@ -225,16 +225,17 @@
|
||||
function(expectation)
|
||||
{
|
||||
if (!expectation.passed()) {
|
||||
failureMessages.push((failureMessages.length + 1) + ': ' + expectation.message);
|
||||
failureMessages.push(expectation.message);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
return {
|
||||
assertions: spec.results().items_.length,
|
||||
className: getNestedSuiteName(spec.suite),
|
||||
name: spec.description,
|
||||
time: spec.duration / 1000,
|
||||
failureMessage: failureMessages.join(' ')
|
||||
failureMessages: failureMessages
|
||||
};
|
||||
}
|
||||
)
|
||||
|
@ -3,10 +3,10 @@
|
||||
<% testsuites.forEach(function(testsuite) { %>
|
||||
<testsuite name="<%- testsuite.name %>" errors="<%= testsuite.errors %>" tests="<%= testsuite.tests %>" failures="<%= testsuite.failures %>" time="<%= testsuite.time %>" timestamp="<%= testsuite.timestamp %>">
|
||||
<% testsuite.testcases.forEach(function(testcase) { %>
|
||||
<testcase classname="<%- testcase.classname %>" name="<%- testcase.name %>" time="<%= testcase.time %>">
|
||||
<% if (testcase.failureMessage) { %>
|
||||
<failure><%= testcase.failureMessage %></failure>
|
||||
<% } %>
|
||||
<testcase assertions="<%= testcase.assertions %>" classname="<%- testcase.classname %>" name="<%- testcase.name %>" time="<%= testcase.time %>">
|
||||
<% testcase.failureMessages.forEach(function(message) { %>
|
||||
<failure><%= message %></failure>
|
||||
<% }) %>
|
||||
</testcase>
|
||||
<% }) %>
|
||||
</testsuite>
|
||||
|
Loading…
Reference in New Issue
Block a user