View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011939CDash(No Category)public2011-03-08 10:262012-01-18 02:32
Reportervipwolf 
Assigned ToJulien Jomier 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformLinuxOSGentooOS Version2010
Product Version1.8 
Target VersionFixed in Version2.0 
Summary0011939: CDASH cannot display Attached Files
DescriptionI tried the new ATTACHED_FILES command introduced in cmake 2.8 with the following command:

set_tests_properties(${TEST} PROPERTIES ATTACHED_FILES "somelogfile.log")

This results in the Test.xml file to contain a line with the following code
<NamedMeasurement name="Attached File" encoding="base64" compression="tar/gzip" filename="network_test1.log" type="file">
<Value> H4sIAAAAAAAAA+2XW2/aSBTH87yfYh57kczcbSP1wcZ2hZRkq2Sz+4gcewhWjIf60rSr/fB7BmhjkyE0Je1qpRweLGT0O/8512G00Es1arJFqYrqb1WPmjob3c2b0XVXlPmoVU07qlR7p+vbmflCnFLfnDzNCMYuxugEMUkYgSeiRDLzXJtwiUSECCY4k5xzeE1dJtEJfqKfH7KuadP6BOP7ENh/lzZN8Sv0/GIjYky9MSWO70tKGKQjisOr9+jVWTA93+TnnxtV3ahWr9pZqdMc7d

I guess this is a tar/gziped version of my logfile and the whole tar/gzip is Base64 encoded. So far so good.

On the CDASH site however the gzipped file is not decoded so all I get is a meaningless Base64 encoded string of my logfile instead of the logfile itself. I guess the decompression routine needs to run over the Attached files and either create the file somewhere for download or in case of txt files display them.
Steps To Reproduce1. Add set_tests_properties(${TEST} PROPERTIES ATTACHED_FILES "somelogfile.log") to CMakeFiles.txt
2. run ctest -T submit
3. Check output on website
Additional InformationI tried turning of the compression of the server but got no meaningfull output as all old tests are compressed.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0025700)
vipwolf (reporter)
2011-03-09 05:24

I made a quick hack to extract the files to a local directory and link to the extracted files instead of showing the base64 encoded content. The "patch" relies on the Archive class from the pear project:

--- testDetails.php 2010-12-13 10:32:32.000000000 +0100
+++ testDetails.php 2011-03-09 11:20:04.000000000 +0100
@@ -26,6 +26,7 @@
 include('login.php');
 include_once("cdash/common.php");
 include('cdash/version.php');
+require_once('Archive/Tar.php');
 
 $testid = $_GET["test"];
 // Checks
@@ -240,7 +241,7 @@
 
 //get any measurements associated with this test
 $xml .= "<measurements>";
-$query = "SELECT name,type,value FROM testmeasurement WHERE testid = '$testid' ORDER BY id";
+$query = "SELECT id,name,type,value FROM testmeasurement WHERE testid = '$testid' ORDER BY id";
 $result = pdo_query($query);
 while($row = pdo_fetch_array($result))
   {
@@ -263,6 +264,30 @@
     {
     $value = nl2br($value);
     }
+ if($row["type"] == "file" )
+ {
+ $outdir="./files/$testid";
+ $tarfile = $outdir.'/'.$row["id"].'.tar.gz';
+ if($outdir!=""&&!file_exists($outdir))
+ {
+ mkdir($outdir,0777);
+ }
+ if($tarfile!=""&&!file_exists($tarfile))
+ {
+ $thandle = fopen($tarfile, "w");
+ fwrite($thandle,base64_decode($value));
+ fclose($thandle);
+ }
+ $tar = new Archive_Tar($tarfile, true);
+ $content =$tar->listContent();
+ $file =basename($content[0]["filename"]);
+ if(!file_exists("$outdir/$file"))
+ {
+ $dir = dirname($content[0]["filename"]);
+ $tar->extractList($content[0]["filename"],$outdir,$dir);
+ }
+ $value = "<a href=$outdir/$file>$file</a>";
+ }
     
   $xml .= add_XML_value("value", $value);
   $xml .= "</measurement>";
(0028346)
Julien Jomier (manager)
2012-01-18 02:32

Files can now be downloaded as .tgz from the tests page. Thanks for the report.

 Issue History
Date Modified Username Field Change
2011-03-08 10:26 vipwolf New Issue
2011-03-09 05:24 vipwolf Note Added: 0025700
2012-01-17 12:30 Julien Jomier Assigned To => Julien Jomier
2012-01-17 12:30 Julien Jomier Status new => assigned
2012-01-18 02:32 Julien Jomier Note Added: 0028346
2012-01-18 02:32 Julien Jomier Status assigned => resolved
2012-01-18 02:32 Julien Jomier Fixed in Version => 2.0
2012-01-18 02:32 Julien Jomier Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team