diff mbox

[OSSTEST,16/17] step logfiles: Populate logfile column with logfile name

Message ID 1498839920-17025-17-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson June 30, 2017, 4:25 p.m. UTC
This is part of a "Populate-then-rely" schema change, as described in
schema/README.updates.  Specifically, this is the final part of the
step:

5. Commit: code to populate new column; changing `add' to status
   Needed and `constraint' to status Ready.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 schema/steps-logfile-constraint.sql | 2 +-
 tcl/JobDB-Executive.tcl             | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/schema/steps-logfile-constraint.sql b/schema/steps-logfile-constraint.sql
index 100bb31..462941e 100644
--- a/schema/steps-logfile-constraint.sql
+++ b/schema/steps-logfile-constraint.sql
@@ -1,4 +1,4 @@ 
--- ##OSSTEST## 004 Unfinished
+-- ##OSSTEST## 004 Ready
 --
 -- Previously, the logfile name was inferred from "stepno" and
 -- "testid".  Newer code will need it to be set explicitly.
diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index ed636e4..0734018 100644
--- a/tcl/JobDB-Executive.tcl
+++ b/tcl/JobDB-Executive.tcl
@@ -281,12 +281,13 @@  proc spawn-step-begin {flight job ts stepnovar} {
 	    } else {
 		set stepno 1
 	    }
+	    set logfile [step-log-leafname $stepno $ts]
 	    db-execute "
 		INSERT INTO steps (flight, job, stepno,
-                                   step, status,
+                                   step, logfile, status,
                                    testid)
 		    VALUES ([pg_quote $flight], [pg_quote $job], $stepno,
-			    [pg_quote $ts], 'running',
+			    [pg_quote $ts], [pg_quote $logfile], 'running',
 			    'STARTING')
 	    "
 	} emsg]} {