Junit test report is corrupt.

Ask general questions here.
dmconsulting1
Posts: 91
Joined: Fri Nov 08, 2019 3:23 pm

Junit test report is corrupt.

Post by dmconsulting1 » Thu Jan 16, 2020 5:55 pm

Not sure if this is happening to anyone else, so I thought I should ask. This is the second time this has happened. The first time I removed and re-added the Automation Helpers and it resolved the issue. That hasn't worked this time.

The tests pass without issue and a PDF report is created, but the junit report is corrupt. I have attached the reports, but here is the gist of the junit report:

<testcase
name="Recipe_Functions"
time="16"
classname="BuildValidation">
<system-out><![CDATA[---[Success] Attribute 'Text' of element for item 'P38Repository.ApplicationUnderTest.Recipe_Name_Field' does match the specified value.---
[type] repoitem
[path] /form[@processname='DrillApp']/?/?/text[@accessiblerole='Text']
[itempath] ?/?/text[@accessiblerole='Text']
[fullname] P38Repository.ApplicationUnderTest.Recipe_Name_Field
[id] a81d27325e374f6a98d6279557e76564
[timeout] 60000
[codefile] c:\Work\P38V&V\P38\Modules\Recipe Functions\BrowseNewRecipe.cs
[itemindex] 8
-------------------------------------------------------------------------------------------------------------------------------------------
---[Success] Attribute 'Text' of element for item 'P38Repository.ApplicationUnderTest.Tool_Set_Field' does match the specified value.---
[type] repoitem
[path] /form[@processname='DrillApp']/text[@controlname='ToolSetTextBox']/text[@accessiblerole='Text']
[itempath] text[@controlname='ToolSetTextBox']/text[@accessiblerole='Text']
[fullname] P38Repository.ApplicationUnderTest.Tool_Set_Field
[id] ab1fa32ac50d4b7bb1bacb3eabed9e82
[timeout] 60000
[codefile] c:\Work\P38V&V\P38\Modules\Recipe Functions\BrowseNewRecipe.cs
[itemindex] 9
----------------------------------------------------------------------------------------------------------------------------------------
---[Success] Attribute 'Text' of element for item 'P38Repository.ApplicationUnderTest.Alignment_Field' does match the specified value.---
[type] repoitem
[path] /form[@processname='DrillApp']/text[@controlname='AlignmentTextBox']/text[@accessiblerole='Text']
[itempath] text[@controlname='AlignmentTextBox']/text[@accessiblerole='Text']
[fullname] P38Repository.ApplicationUnderTest.Alignment_Field
[id] 65662d3889c047de9d2a7c01bca1a2cd
[timeout] 60000
[codefile] c:\Work\P38V&V\P38\Modules\Recipe Functions\BrowseNewRecipe.cs
[itemindex] 10
-----------------------------------------------------------------------------------------------------------------------------------------
]]></system-out>
</testcase>
Attachments
pdfReport.png
pdfReport.png (57.49 KiB) Viewed 280 times
BuildReport2020.rxlog.junit.xml
(33.93 KiB) Downloaded 10 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 12138
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Junit test report is corrupt.

Post by Support Team » Thu Jan 16, 2020 10:10 pm

Hello,

This issue is being handled via a support ticket, the resolution will be posted here for reference.


-Sean
Regards,
.
Image

dmconsulting1
Posts: 91
Joined: Fri Nov 08, 2019 3:23 pm

Re: Junit test report is corrupt.

Post by dmconsulting1 » Fri Jan 17, 2020 3:10 pm

Thanks again for the help on this, Sean. It seems the report is correct and is reporting back to TFS correctly.

Deleting the old reports from the agent seems to have corrected the issue. I would be interested in knowing what caused it. But at least I have an idea of how to resolve it should it happen again.

dmconsulting1
Posts: 91
Joined: Fri Nov 08, 2019 3:23 pm

Re: Junit test report is corrupt.

Post by dmconsulting1 » Thu Feb 06, 2020 9:21 pm

So here we are again. I am finding I have to clear the Uploads folder out on the Agent every so often or this report is corrupt again.

One issue seems to be file rights as I need admin to delete, so a cleanup routine won't work. But why does it get corrupt in the first place?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12138
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Junit test report is corrupt.

Post by Support Team » Fri Feb 07, 2020 9:42 pm

Hello dmconsulting1,

I recommend creating a support query or replying to the previous case regarding this issue as it appears to be intermittent and will require additional research.

Regards,
Sean
.
Image

dmconsulting1
Posts: 91
Joined: Fri Nov 08, 2019 3:23 pm

Re: Junit test report is corrupt.

Post by dmconsulting1 » Wed Feb 19, 2020 8:12 pm

Haha, I feel like an idiot, but at least I know what it is now.

So I was calling the agent with the argument /junit /zr /zrf:Reports/BuildReport where BuildReport is the file name. It was reusing the same log file for each test run. If a test run failed, the log contained more information and therefor was longer in character length. If the next test that ran happened to be shorter than the previous (like a pass vs fail) only the new info was overwritten but the remaining text from the failure remained.

So TFS reported:
##[warning]Failed to read C:\agent2\_work\9\s\Reports\BuildReport.rxlog.junit.xml. Error : Data at the root level is invalid. Line 189, position 13.

Line 189 looks like this:
</testsuite>uite>

The first test was 5 characters longer. :lol: