lukejpreston / junit_viewer

Start a mini service to view junit reports
39 stars 17 forks source link

Parse Error: < 3.0 #31

Closed pickworth closed 7 years ago

pickworth commented 8 years ago

Looks like the beginning of the output is truncated and showing "Parse Error: < 3.0"

I am using mocha to output the junit test via mocha-jenkins-reporter.

the junit file is parsed correctly via Jenkins CI user interface, but junit-viewer seems to have some problems

this is how the html is output from the very beginning of the output (showing only the first 19 lines):

Parse Error: < 3.0</span>
       <span class="label u-pull-right">time: 0.001</span>
   </button>

</div>

   </div>
</div>

<div class="suite" id="suite_tSVB8">
   <button class="suite--passed u-full-width flat" onclick="toggleContraction(this.parentElement)">
       <span class="suite__name u-pull-left">API tests</span>
       <span class="label u-pull-right">tests: 4</span>
<span class="label u-pull-right">failures: 0</span>
<span class="label u-pull-right">skipped: 0</span>
<span class="label u-pull-right">timestamp: Tue, 23 Aug 2016 02:27:07 GMT</span>
<span class="label u-pull-right">time: 1.235</span>
   </button>
   <div class="suite__contents">
...       
lukejpreston commented 8 years ago

can you give sample mocha output file?

wrlyonsjr commented 7 years ago

All you have to do to trigger this issue with junit 4 is have a test fail on assertEquals. The default output of a failed assert equals is: expected:<[expected]Value> but was:<[actual]Value> The <>s trigger the parse error.

pickworth commented 7 years ago

@lukejpreston I have given the output file (first 20 lines or so) in the original post. I truncated the end as it is irrelevant, and seems fine. The beginning of the Output file should obviously be an HTML element, not Parse Error: < 3.0

It seems that 3/4 of the actual expected HTML is just plain missing from the start of the output..

@wrlyonsjr interesting..

evansiroky commented 7 years ago

A workaround for this is to run with the option --minify=false.

For example: junit-viewer --results=target/surefire-reports/ --port --minify=false

ghost commented 7 years ago

Observed this issue as well - the workaround @evansiroky mentioned works

lukejpreston commented 7 years ago

this project is now deprecated, please see https://github.com/lukejpreston/xunit-viewer which supports the same features

I think the above works there