Implemented exporting Smoke Test Report to Diamonds
authorMaciej Seroka <maciejs@symbian.org>
Thu, 10 Dec 2009 15:51:05 +0000
changeset 821 b24df46a3102
parent 820 2a9e6403efaf
child 822 1a356be50bf9
Implemented exporting Smoke Test Report to Diamonds
common/diamonds/linksForDiamonds.xml.ftl
common/tools/ats/ats_specialise_test_drop.pl
--- a/common/diamonds/linksForDiamonds.xml.ftl	Wed Dec 09 15:55:13 2009 +0000
+++ b/common/diamonds/linksForDiamonds.xml.ftl	Thu Dec 10 15:51:05 2009 +0000
@@ -22,19 +22,24 @@
       <name>Build Logs</name>
       <url>file:///${ant['sf.spec.publish.networkdrive']}\${ant['sf.spec.job.name']}\builds\${ant['sf.spec.job.codeline']}\${ant['build.id']}\build_logs.zip</url>
     </file>
-	<#if "${ant['sf.spec.bccheck.enable']}" = "true" && "${ant['sf.spec.bccheck.enable.ha']}" = "true">
-	  <file>
+    <file>
+      <type>log</type>
+      <name>Smoke Test Report</name>
+      <url>file:///${ant['sf.spec.publish.networkdrive']}\${ant['sf.spec.job.name']}\builds\${ant['sf.spec.job.codeline']}\${ant['build.id']}\ats_reports\ATS3Report.html</url>	  
+    </file>
+    <#if "${ant['sf.spec.bccheck.enable']}" = "true" && "${ant['sf.spec.bccheck.enable.ha']}" = "true">
+      <file>
         <type>log</type>
         <name>Binary Compatibility Report (Headerfiles)</name>
-		<url>file:///${ant['sf.spec.publish.networkdrive']}\${ant['sf.spec.job.name']}\builds\${ant['sf.spec.job.codeline']}\${ant['build.id']}\BC\headers_report.xml</url>	  
-	  </file>
-	</#if>
-	<#if "${ant['sf.spec.bccheck.enable']}" = "true" && "${ant['sf.spec.bccheck.enable.la']}" = "true">
-	  <file>
+        <url>file:///${ant['sf.spec.publish.networkdrive']}\${ant['sf.spec.job.name']}\builds\${ant['sf.spec.job.codeline']}\${ant['build.id']}\BC\headers_report.xml</url>	  
+      </file>
+    </#if>
+    <#if "${ant['sf.spec.bccheck.enable']}" = "true" && "${ant['sf.spec.bccheck.enable.la']}" = "true">
+      <file>
         <type>log</type>
         <name>Binary Compatibility Report (Libraries)</name>
-		<url>file:///${ant['sf.spec.publish.networkdrive']}\${ant['sf.spec.job.name']}\builds\${ant['sf.spec.job.codeline']}\${ant['build.id']}\BC\libraries_report.xml</url>	  
-	  </file>
-	</#if>	
+        <url>file:///${ant['sf.spec.publish.networkdrive']}\${ant['sf.spec.job.name']}\builds\${ant['sf.spec.job.codeline']}\${ant['build.id']}\BC\libraries_report.xml</url>	  
+      </file>
+    </#if>	
    </files>
 </diamonds-build>
\ No newline at end of file
--- a/common/tools/ats/ats_specialise_test_drop.pl	Wed Dec 09 15:55:13 2009 +0000
+++ b/common/tools/ats/ats_specialise_test_drop.pl	Thu Dec 10 15:51:05 2009 +0000
@@ -62,6 +62,10 @@
           'publish=s') 
           or usage_error();
 
+# Check if Tie::File module installed
+eval("use Tie::File");
+if ($@) { $publish = '' };
+		  
 if ($help) {
 	help();
 }
@@ -127,7 +131,7 @@
 $test_drop->{'test'}->{'buildid'}->[0] = $build_id, if $build_id;
 # Insert the FileStoreAction parameter
 my $postaction_params = $test_drop->{'test'}->{'postAction'}->[0]->{'params'}->{'param'}, if $publish;
-$postaction_params->[1] = { 'name' => "to-folder", 'value' => $publish . "\\ats_reports" }, if $publish;
+$postaction_params->[1] = { 'name' => "to-folder", 'value' => $publish }, if $publish;
 
 if ($host_name) { # Also insert specified host name
 	my $devices = $test_drop->{'test'}->{'target'}->[0]->{'device'};
@@ -152,6 +156,21 @@
     open OUT,">test.xml" or die("Cannot open file \"test.xml\" for writing. $!\n");
     print OUT XMLout($test_drop, keeproot => 1);
     close OUT;
+	if ($publish) { #Move <type>FileStoreAction</type> above <params>
+		my @lines;
+		tie @lines, 'Tie::File', "test.xml" or die("Cannot tie file \"test.xml\". $!\n");
+		my $current_line = 0;
+		for (@lines) {
+			if (/FileStoreAction/) {
+				my $line_to_move = @lines[$current_line];
+				splice @lines, $current_line, 1;
+				splice @lines, $current_line-4, 0, $line_to_move;
+				last;
+			}
+		  $current_line++;
+	    }
+	untie @lines;
+	}
     if ( -f "$destfile.zip") {
         unlink("$destfile.zip") or die("Could not delete \"$destfile.zip\": $!\n");
     }