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

[Xen-devel] [OSSTEST PATCH 1/2] other_revision_job_suffix: Take and pass referring runvar name


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Mon, 30 Sep 2019 15:57:11 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@xxxxxxxxxxxxx; spf=Pass smtp.mailfrom=Ian.Jackson@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 30 Sep 2019 14:57:25 +0000
  • Ironport-sdr: L+jj0GUDBDQwJqinpkJM3jD+k33CMUV0q7C7tKSWUryg+cRncV8ZeHP17R0PH59tQL6tclBVB9 o4zkp+N0RPblLUEpOOgvo7OppTIrG73YzKfyxksVHgqrWvz2oxwfIDhITnk+Rda22Jt6kOZJG3 CzeDDMYBGnATXbRmE3aXL/iOsbhXyVUoqME8aKGSbjwfOrjfvPR8Bsr/0a/r2fqUs2VvtPwRYd JDnHDZIqiUbXNPLX9mIUQgdtXi0BRbErOJDveTp5SX3BXYYZaia42sa2ARV1Po3bEg1Yzoa2el Qqw=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

We are going to need this to sort out bisection for freebsd's
recursive builds.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest.pm        |  6 +++---
 cs-bisection-step | 17 +++++++++--------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/Osstest.pm b/Osstest.pm
index 7ce53fcb..561d584c 100644
--- a/Osstest.pm
+++ b/Osstest.pm
@@ -374,8 +374,8 @@ sub flight_otherjob ($$) {
            confess "$otherflightjob ?";
 }
 
-sub other_revision_job_suffix ($$) {
-    my ($jobfield, $separator) = @_;
+sub other_revision_job_suffix ($$$) {
+    my ($jobfield, $refrunvar, $separator) = @_;
     return <<END
       (CASE
        WHEN ($jobfield) LIKE 'build-%-prev' THEN '${separator}prev'
@@ -386,7 +386,7 @@ END
 
 sub main_revision_job_cond ($) {
     my ($jobfield) = @_;
-    return "(${\ other_revision_job_suffix($jobfield,'x') } = '')";
+    return "(${\ other_revision_job_suffix($jobfield,'x','x') } = '')";
 }
 
 sub get_harness_rev () {
diff --git a/cs-bisection-step b/cs-bisection-step
index 05bfaa0a..48208e46 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -232,7 +232,7 @@ END
         SELECT url.val AS uval,
               rev.val AS rval,
               url.job AS job,
-               ${\ other_revision_job_suffix('url.job',' ') } AS othrev,
+      ${\ other_revision_job_suffix('url.job','url.use',' ') } AS othrev,
               url.name AS longname
 
            FROM tmp_build_info AS rev
@@ -1135,9 +1135,9 @@ our %jobs_created;
 our %builds_investigated; # $builds_investigated{$popjob} = 0, or {..row..}
 our %recursion_track;
 
-sub preparejob ($$$);
-sub preparejob ($$$) {
-    my ($popjob, $copyflight, $cacheok) = @_;
+sub preparejob ($$$$);
+sub preparejob ($$$$) {
+    my ($popjob, $copyflight, $refrunvar, $cacheok) = @_;
     # runs in db_retry qw(flights)
 
     if (exists $jobs_created{$popjob}) {
@@ -1168,13 +1168,13 @@ END
         SELECT name FROM runvars
           WHERE  flight=? AND job=?
             AND  name = ?
-            AND  ${\ other_revision_job_suffix('job',' ') } = ?
+            AND  ${\ other_revision_job_suffix('job','?',' ') } = ?
 END
     foreach (my $i=0; $i<@treeinfos; $i++) {
         my $name= $treeinfos[$i]{Name};
        my $othrev = $name =~ s{ (.+)$}{} ? $1 : '';
         my $treevar= 'tree_'.$name;
-        $treeq->execute($copyflight, $popjob, $treevar, $othrev);
+        $treeq->execute($copyflight, $popjob, $treevar, $refrunvar, $othrev);
         my ($treerow) = $treeq->fetchrow_array();
         $treeq->finish();
         next unless defined $treerow;
@@ -1312,7 +1312,8 @@ END
             print STDERR "Reusing $target for $subjob->{name}".
                 " in $popflight.$popjob\n";
         } else {
-            $target= preparejob($subjob->{job}, $subjob->{orgflight}, 1);
+            $target= preparejob($subjob->{job}, $subjob->{orgflight},
+                               $subjob->{name}, 1);
         }
         $jobsetq->execute($target, $popflight, $popjob, $subjob->{name});
     }
@@ -1339,7 +1340,7 @@ END
     db_retry($popflight,'constructing', $dbh_tests,[qw(flights)], sub {
         print STDERR "Populating $popflight...\n";
        undef %jobs_created;
-        preparejob($job, $latest_flight, 0);
+        preparejob($job, $latest_flight, '', 0);
         foreach my $hostspec (split /,/, $hosts) { # /
             $hostspec =~ m/=/;
             $addvar->execute($popflight, $job, $`, $'); # '
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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