[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 40/60] sg-report-job-history: Refactor "ALL" handling


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:45 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:23:00 +0000
  • Ironport-sdr: 57fGnd9QyUDalP3QxlumkonaepdRwz5uQcg/r75btipjpiouLVGxOdsUJRVO7f75Ub7Se1bMlf 2pY4pQRgnBIn8X8DMydzXZYxaNF826KG2gVX7nJiGvO5K4oN1d/phLmrG5VCgF7sNjjUeoD+4i OhtYmFOuvawtIO+PU09jl4Itj1YuSVQlbNH/rfZ8lHOD2qsQhiEAxLO0dFJCty3Larnog28fYY xXw/DY8yDJmQo4xAFsKGspP89Zke4SESow4M9lYz5njnauhZB2l8eyRuy27udDrfa4HaVySD9z Prg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

* Make an explicit entry ALL in @branches, rather than implicitly
  processing ALL as well.

* Consequently, put explicit ALL entries in @tasks too, rather than
  putting in entries without a branch name.

* Pass ALL to processjobbranch rather than undef, and turn it into
  the internally-used undef at the start.

When used with --flight (findflight), this has no functional change.
When used with --job, ALL must now be included in the branch
list passed to --branches.  The only in-tree call is with --flight.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-job-history | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sg-report-job-history b/sg-report-job-history
index 3b45992f..8932458e 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -72,7 +72,7 @@ sub findflight () {
         SELECT branch FROM flights WHERE flight=?
 END
     die "$flight ? @$branches ?" if @$branches!=1;
-    @branches= @$branches;
+    @branches= ('ALL', @$branches);
 
     my $selectq= db_prepare(<<END);
         SELECT job FROM jobs WHERE flight=? ORDER BY JOB
@@ -110,7 +110,10 @@ END
 }
 
 sub processjobbranch ($$$) {
-    my ($j,$bra,$html_file) = @_;
+    my ($j,$branch_or_all,$html_file) = @_;
+
+    my $bra = $branch_or_all;
+    undef $bra if $bra eq 'ALL';
 
     my $buildsq= db_prepare(<<END);
         SELECT * FROM runvars
@@ -294,14 +297,13 @@ END
 
 my @tasks;
 foreach my $j (@jobs) {
-    push @tasks, $j;
     push @tasks, "$j $_" foreach @branches;
 }
 
 parallel_by_fork('sg-report-job-history', $maxjobs, \@tasks, sub {
     my ($task) = @_;
     my ($job, $branch) = split / /, $task; # $branch might be undef
-    my $html_file = sprintf "history/%s/%s.html", $job, ($branch // 'ALL');
+    my $html_file = sprintf "history/%s/%s.html", $job, $branch;
     db_retry($dbh_tests, [], sub {
         processjobbranch($job, $branch, $html_file);
     });
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.