CDash icon indicating copy to clipboard operation
CDash copied to clipboard

CDash server responding with `Error parsing XML in stream at line 1: syntax error` for Coverage XML

Open tamuseanmiller opened this issue 2 years ago • 10 comments
trafficstars

I'm hoping this is a CDash issue and not a CMake/CTest issue but let me know. After calling my dashboard script for Windows/MacOS I'm generating a Cobertura XML and parsing with ctest_coverage() this eventually gets the code coverage successfully and prints

Covered LOC:         4275
Not covered LOC:     7736
Total LOC:           12011
Percentage Coverage: 35.59%

But when uploading with ctest_submit(), it throws the error above in the title:

Submit files
   Send to group: Experimental
   SubmitURL: http://.../submit.php?project=...
   Upload file: .../build/Testing/20230428-1929/Configure.xml to http://.../submit.php?project=...&FileName=___Test-Windows___20230428-1929-Experimental___XML___Configure.xml&build=Test-Windows&site=&stamp=20230428-1929-Experimental&MD5=eacd34b0c78d610d105a4229ad6b0caa Size: 1456
   Uploaded: .../build/Testing/20230428-1929/Configure.xml
   Upload file: .../build/Testing/20230428-1929/Build.xml to http://.../submit.php?project=...&FileName=___Test-Windows___20230428-1929-Experimental___XML___Build.xml&build=Test-Windows&site=&stamp=20230428-1929-Experimental&MD5=67f3f9e1b345b477e2982d8e103a1f8b Size: 1051
   Uploaded: .../build/Testing/20230428-1929/Build.xml
   Upload file: .../build/Testing/20230428-1929/Test.xml to http://.../submit.php?project=...&FileName=___Test-Windows___20230428-1929-Experimental___XML___Test.xml&build=Test-Windows&site=&stamp=20230428-1929-Experimental&MD5=2bdfe8cfbeed66ff91f482c672821ac6 Size: 396543
   Uploaded: .../build/Testing/20230428-1929/Test.xml
   Upload file: Coverage.xml to http://.../submit.php?project=...&FileName=___Test-Windows___20230428-1929-Experimental___XML___Coverage.xml&MD5=0ba8793d92dc4400e4c2cae02ed5a845 Size: 60285783
Error parsing XML in stream at line 1: syntax error
   Uploaded: Coverage.xml
   Upload file: .../build/Testing/20230428-1929/CoverageLog-0.xml to http://.../submit.php?project=...&FileName=___Test-Windows___20230428-1929-Experimental___XML___CoverageLog-0.xml&build=Test-Windows&site=&stamp=20230428-1929-Experimental&MD5=e8363868f628e4f1d5837a8f2c1c4134 Size: 961198
   Uploaded: .../build/Testing/20230428-1929/CoverageLog-0.xml
   Upload file: .../build/Testing/20230428-1929/CoverageLog-1.xml to http://.../submit.php?project=...&FileName=___Test-Windows___20230428-1929-Experimental___XML___CoverageLog-1.xml&build=Test-Windows&site=&stamp=20230428-1929-Experimental&MD5=c33a41045efc7e4d861257db1d0ace02 Size: 968575
   Uploaded: .../build/Testing/20230428-1929/CoverageLog-1.xml
   Upload file: .../build/Testing/20230428-1929/CoverageLog-2.xml to http://.../submit.php?project=...&FileName=___Test-Windows___20230428-1929-Experimental___XML___CoverageLog-2.xml&build=Test-Windows&site=&stamp=20230428-1929-Experimental&MD5=880ed998535cb2b31ab2de7337101000 Size: 824903
   Uploaded: .../build/Testing/20230428-1929/CoverageLog-2.xml
   Upload file: .../build/Testing/20230428-1929/Done.xml to http://.../submit.php?project=...&FileName=___Test-Windows___20230428-1929-Experimental___XML___Done.xml&build=Test-Windows&site=&stamp=20230428-1929-Experimental&MD5=d80d8aeff2d497aef8c907aac62aef81 Size: 105
   Uploaded: .../build/Testing/20230428-1929/Done.xml
   Submission successful

So every submission is successful except for Coverage.xml. This error only happens when it parses with Cobertura XMLs so far in my testing but that's all that we can use at the moment. I'll post the top few lines of the Coverage.xml file below:

<?xml version="1.0" encoding="UTF-8"?>
<Site BuildName="Test-Windows"
	BuildStamp="20230428-1929-Experimental"
	Name="(empty)"
	Generator="ctest-3.25.0-rc4"
	CompilerName=""
	CompilerVersion=""
	OSName="Windows"
	Hostname="..."
	OSRelease=" Professional"
	OSVersion=" (Build 22621)"
	OSPlatform="AMD64"
	Is64Bits="1"
	VendorString="GenuineIntel"
	VendorID="Intel Corporation"
	FamilyID="6"
	ModelID="12"
	ProcessorCacheSize="-1"
	NumberOfLogicalCPU="8"
	NumberOfPhysicalCPU="4"
	TotalVirtualMemory="32475"
	TotalPhysicalMemory="16091"
	LogicalProcessorsPerPhysical="2"
	ProcessorClockFrequency="2611.00"
	>
	<Coverage>
		<StartDateTime>Apr 28 15:30 Eastern Daylight Time</StartDateTime>
		<StartTime>1682710212</StartTime>
		<File Name="....cpp" FullPath="./....cpp" Covered="true">
			<LOCTested>0</LOCTested>
			<LOCUnTested>89</LOCUnTested>
			<PercentCoverage>0.00</PercentCoverage>
			<CoverageMetric>0.10</CoverageMetric>
		</File>
...

I'm able to reproduce this same issue on MacOS as well. Any ideas or further logs I can provide?

I should also note, the dashboard does not show any new Coverage build when this uploads as well.

tamuseanmiller avatar Apr 28 '23 19:04 tamuseanmiller

What version of CDash are you running?

williamjallen avatar Apr 30 '23 14:04 williamjallen

What version of CDash are you running?

The latest currently (3.1.0?)

tamuseanmiller avatar Apr 30 '23 15:04 tamuseanmiller

Any ideas or more information I can provide here?

tamuseanmiller avatar May 02 '23 14:05 tamuseanmiller

I don't see anything out of the ordinary in the file you provided, but @zackgalbreath probably knows this part of the codebase better than I do.

Things that might be helpful if you're able to provide them:

  1. The project name (or at least the characters being used in the project name)
  2. A more complete Coverage.xml
  3. Any relevant CDash log data

williamjallen avatar May 02 '23 15:05 williamjallen

Hey @williamjallen, thanks for taking a look here. I'll try and provide some more of this information, but as most of this is proprietary information I will attempt to censor some things.

  1. The project name uses dashes like this: test-name-proj with all letters
  2. Coverage.xml.zip
  3. I'll open up the CDash server and drop some logs in another comment if I see anything useful

tamuseanmiller avatar May 02 '23 15:05 tamuseanmiller

So I'm not seeing any cdash.log file in the CDash/backup directory on the server.

tamuseanmiller avatar May 02 '23 16:05 tamuseanmiller

I'm afraid this issue has gone stale. Any ideas @zackgalbreath ?

tamuseanmiller avatar May 16 '23 14:05 tamuseanmiller

Thanks for the example. I tested it out locally. It did help me catch a recent regression (addressed in #1433) but otherwise the file parsed cleanly for me.

We're hoping to release CDash 3.2 in a couple weeks. Perhaps we can revisit this issue again to see if it's still a problem for you?

zackgalbreath avatar May 16 '23 19:05 zackgalbreath

Thanks for the example. I tested it out locally. It did help me catch a recent regression (addressed in #1433) but otherwise the file parsed cleanly for me.

We're hoping to release CDash 3.2 in a couple weeks. Perhaps we can revisit this issue again to see if it's still a problem for you?

Interesting, I wouldn't even know how to repro this issue for you as I can still upload other info to the server. For example, I can call the Experimental target from include(CTest) from cmake and it will work on a couple generators. We're using that as placeholder for the moment but we really want the ability to customize it how you would with a dashboard script.

I'll wait for the 3.2 release and update when it comes then I'll shoot back here if the issue sticks around.

tamuseanmiller avatar May 17 '23 16:05 tamuseanmiller