From: Ian Jackson Date: Thu, 29 Jun 2017 16:13:50 +0000 (+0100) Subject: step logfiles: Rely on new logfile column X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=81cd60a526aa6fc733862bb024ee908d11f8af80;p=people%2Faperard%2Fosstest.git step logfiles: Rely on new logfile column These are the three places which read logfile from the db, but had a fallback to a computation involving stepno and step. But, after steps-logfile-constraint, the logfile column is NOT NULL (and populated with computed default data if need be) so this is not needed any more This is part of a "Populate-then-rely" schema change, as described in schema/README.updates. Specifically, the step: 10. Optionally commit: code which relies on new column, and does not necessarily tolerate NULL/DEFAULT; changing `constraint' to Needed. Signed-off-by: Ian Jackson --- diff --git a/determine-failure-reasons b/determine-failure-reasons index cf40ca3b..1ede7383 100755 --- a/determine-failure-reasons +++ b/determine-failure-reasons @@ -52,7 +52,7 @@ sub gethosts ($) { } while (my $step= $stepsq->fetchrow_hashref) { - my $logfile = $step->{logfile} // "$step->{stepno}.$step->{step}.log"; + my $logfile = $step->{logfile}; $step->{Log}= "$c{Logs}/$step->{flight}/$step->{job}/".$logfile; if (!stat $step->{Log}) { diff --git a/schema/steps-logfile-constraint.sql b/schema/steps-logfile-constraint.sql index 5895f45c..f6f8a744 100644 --- a/schema/steps-logfile-constraint.sql +++ b/schema/steps-logfile-constraint.sql @@ -1,4 +1,4 @@ --- ##OSSTEST## 004 Ready +-- ##OSSTEST## 004 Needed -- -- Previously, the logfile name was inferred from "stepno" and -- "testid". Newer code will need it to be set explicitly. diff --git a/sg-report-flight b/sg-report-flight index e69efb7f..2f5c3911 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -1001,8 +1001,7 @@ END printf H "%s", show_abs_time $step->{started}; my $st= $step->{status}; - my $logfilename= $step->{logfile} - // "$step->{stepno}.$step->{step}.log"; + my $logfilename= $step->{logfile}; printf H "%s", (html_status2_colour_priority($st))[0], encode_entities(uri_escape($logfilename)), @@ -1168,7 +1167,7 @@ END : ('#ffff00',250); } my $ch = "bgcolor=\"$bgc\""; - my $logfilename= $s->{logfile} // "$s->{stepno}.$s->{step}.log"; + my $logfilename= $s->{logfile}; my $h = "{job}). "/".encode_entities($logfilename)."\">"; #print H "[$s->{stepno}] ";