diff mbox series

[OSSTEST,42/60] sg-report-job-history (nfc): Add new hostvarcols calculation

Message ID 20200814172205.9624-43-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Speed up sg-report-job-history | expand

Commit Message

Ian Jackson Aug. 14, 2020, 5:21 p.m. UTC
We are going to want to replace the existing @hostvarcols
calculation.  Provide a new one based on $ri->{Hosts}.

Right now, die if they don't produce the same answers.  This still
works, which shows that the calculation is right.

Tested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 sg-report-job-history | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/sg-report-job-history b/sg-report-job-history
index 118926c6..fb2930a9 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -206,6 +206,13 @@  END
         push @test_rows, $ri;
     }
 
+    my %hostvarnames;
+    foreach my $ri (@test_rows) {
+	$hostvarnames{$_}=1 foreach keys %{ $ri->{Hosts} }
+    }
+    my @hostvarcols2 = sort keys %hostvarnames;
+    die unless "@hostvarcols" eq "@hostvarcols2";
+
     my $osstestverq= db_prepare(<<END);
         SELECT DISTINCT harness
           FROM flights_harness_touched