TL;DR: 2 issues and 1 question for uploading files to CDash:
- Images uploaded via
ATTACHED_FILESare not shown directly but are presented as .tgz - Images uploaded via
CTestMeasurement...are truncated to 64kb in a default database setup (MariaDB 10.6). - Why are there two different locations for storing uploaded images/files?
More Details:
I experimented with uploading images from tests with ctest, and found it nice that this already exists and is quite well supported! I did have minor issues though:
-
As reported in this discussion, images uploaded via the ATTACHED_FILES mechanism end up as .tgz files instead of being directly shown. It would be nice if CDash directly would display such image files (same as for files uploaded via the
CTestMeasurementmechanism, see below). The tarball adds unnecessary additional steps for each check (in addition to opening the specific test, one needs to download, extract gz, etxtract tar, and open the image). -
A workaround is to use the
<CTestMeasurement ...test output as described here in the CTest documentation under Attached Files / Additional Test Measurements. Images uploaded withtype="image/png"(or jpg/…) are shown directly in the test results - exactly what I want.
This is however a bit more complex for some cases than simply setting theATTACHED_FILESproperty. We do kind of integration tests, and so our tests directly run a (shipped) command line tool where we do not want to include logic for creating the<CTestMeasurement...XML output. So we would need to wrap the call to this tool into a custom script that runs the actual test, and afterwards outputs that required xml snippet.
When I tested the<CTestMeasurement ...approach, I found that the uploaded image was truncated (CDash 3.4.0, database not completely newly created but probably not older than from 3.3.0). After some digging I found out that in the database in theimagetable, only the first 64KB were stored due to theimgcolumn being of typeBLOBwhich can only story 64kb in mysql/mariadb. Is this intentional? While I agree that some restriction on the file sizes of uploaded test files does make sense, I did not see any mention of the 64kb limit in the documentation. After changing the column type toMEDIUMBLOB, everything worked as expected. Looking at the database setup script for the image table, this column uses the ‘binary’ type from Illuminate; the Illuminate documentation on binary says this maps to BLOB but does not explicitly mention whether there is a way to specify a “larger” blob type like mediumblob or longblob there - possibly by adding a size parameter to thebinarycall? -
What I also found out is that files uploaded via
ATTACHED_FILESare stored completely differently (these go into thetestmeasurementtable) than images uploaded via theCTestMeasurementmechanism (these go into theimagestable). Thevaluecolumn in thetestmeasurementtable uses amediumtext(extended by this change, so it isn’t affected by the 64kb restrictions, though it uses a little more memory due to it being I think base64 encoded).
I find it confusing that images uploaded via the CTestMeasurement do not go intotestmeasurement; why are there even two storage locations for the same kind of data?