Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing test report with failed chained test errors #25

Closed
mmiller-max opened this issue Aug 21, 2020 · 1 comment · Fixed by #30
Closed

Printing test report with failed chained test errors #25

mmiller-max opened this issue Aug 21, 2020 · 1 comment · Fixed by #30
Labels
bug Something isn't working

Comments

@mmiller-max
Copy link
Member

Came across this nice one recently.

MWE:

using Test
using TestReports

ts = @testset ReportingTestSet "test" begin
    @test true && false
end

report(ts)

Results in this error:

ERROR: AssertionError: isempty(XML_GLOBAL_ERROR_STACK)
Stacktrace:
 [1] macro expansion at /Users/malmiller/.julia/packages/EzXML/BF7Lf/src/error.jl:49 [inlined]
 [2] ElementNode(::String) at /Users/malmiller/.julia/packages/EzXML/BF7Lf/src/node.jl:479
 [3] failure_xml(::String, ::String, ::String) at /Users/malmiller/repos/TestReports.jl/src/to_xml.jl:43
 [4] to_xml(::Test.Fail) at /Users/malmiller/repos/TestReports.jl/src/to_xml.jl:120
 [5] (::TestReports.var"#4#5")(::Test.Fail) at /Users/malmiller/repos/TestReports.jl/src/to_xml.jl:102
 [6] iterate at ./generator.jl:47 [inlined]
 [7] _collect(::Array{Test.Fail,1}, ::Base.Generator{Array{Test.Fail,1},TestReports.var"#4#5"}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:699
 [8] collect_similar(::Array{Test.Fail,1}, ::Base.Generator{Array{Test.Fail,1},TestReports.var"#4#5"}) at ./array.jl:628
 [9] map(::Function, ::Array{Test.Fail,1}) at ./abstractarray.jl:2162
 [10] to_xml(::ReportingTestSet) at /Users/malmiller/repos/TestReports.jl/src/to_xml.jl:101
 [11] (::TestReports.var"#2#3")(::ReportingTestSet) at /Users/malmiller/repos/TestReports.jl/src/to_xml.jl:78
 [12] iterate at ./generator.jl:47 [inlined]
 [13] _collect(::Array{Test.AbstractTestSet,1}, ::Base.Generator{Array{Test.AbstractTestSet,1},TestReports.var"#2#3"}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:699
 [14] collect_similar(::Array{Test.AbstractTestSet,1}, ::Base.Generator{Array{Test.AbstractTestSet,1},TestReports.var"#2#3"}) at ./array.jl:628
 [15] map(::Function, ::Array{Test.AbstractTestSet,1}) at ./abstractarray.jl:2162
 [16] report(::ReportingTestSet) at /Users/malmiller/repos/TestReports.jl/src/to_xml.jl:77
 [17] top-level scope at REPL[29]:1
 [18] include_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1088
@mmiller-max mmiller-max added the bug Something isn't working label Aug 21, 2020
@mmiller-max
Copy link
Member Author

Turns out this is occurs when an attribute value given to AttributeNode contains "&&".

JuliaIO/EzXML.jl#149

We can, however, use setindex! to set the attribute and this uses a different call to libxml2 and converts "&&" to "&&amp".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant