You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue trying to convert JUnit XML output from TestReports.jl to html using any package. None of them were displayed the result from an exception being thrown.
I couldn't find a clear definition for what the XML format is supposed to be, but I believe the element needs to be wrapped in a element for other packages to parse it correctly.
Below, I have example tests that throw errors and my proposed fix.
using Test
using TestReports
# Current behavior
ts =@testset ReportingTestSet ""begin@testset"Normal tests"begin@testtrue@testfalseend@testset"Error inside test"begin@testtrue@testfalse@test doesntexist ==1end@testset"Error outside test"begin@testtrue@testfalse
a = doesntexist
endendprintln("This XML puts <error> as direct children of <testsuite>")
TestReports.EzXML.prettyprint(report(ts))
# Update to put error result inside a test case.function TestReports.to_xml(v::TestReports.Error)
message, type, ntest = TestReports.get_error_info(v)
x_error = TestReports.error_xml(message, type, v.backtrace)
x_testcase = TestReports.testcase_xml(v, [x_error])
x_testcase, ntest, 0, 1# Increment number of errors by 1end
ts =@testset ReportingTestSet ""begin@testset"Normal tests"begin@testtrue@testfalseend@testset"Error inside test"begin@testtrue@testfalse@test doesntexist ==1end@testset"Error outside test"begin@testtrue@testfalse
a = doesntexist
endendprintln("This XML puts <error> as direct children of <testcase>")
TestReports.EzXML.prettyprint(report(ts))
The text was updated successfully, but these errors were encountered:
I encountered an issue trying to convert JUnit XML output from TestReports.jl to html using any package. None of them were displayed the result from an exception being thrown.
I couldn't find a clear definition for what the XML format is supposed to be, but I believe the element needs to be wrapped in a element for other packages to parse it correctly.
Below, I have example tests that throw errors and my proposed fix.
The text was updated successfully, but these errors were encountered: