diff mbox

[OSSTEST,3/3] sg-report-flight: Avoid some warnings when reporting unexecuted jobs

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

Commit Message

Ian Jackson Oct. 6, 2016, 12:14 p.m. UTC
If no steps in a job are executed, there can be a failure with a
synthetic step row, containing a stepno of ''.  This causes a perl
warning when compared with <=>:
  Argument "" isn't numeric in numeric comparison (<=>) at ./sg-report-flight line 774.

Fix this by replacing falseish values with 0.

Bug introduced in 0e09a8b00ec6 "sg-report-flight: Report earlier,
earlier step failures".

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 sg-report-flight | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/sg-report-flight b/sg-report-flight
index dbb17be..c66525b 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -774,7 +774,7 @@  END
 
     @failures= sort {
 	$a->{DurationEstimate} <=> $b->{DurationEstimate}
-	or $a->{Step}{stepno} <=> $b->{Step}{stepno}
+	or ($a->{Step}{stepno} || 0) <=> ($b->{Step}{stepno} || 0)
 	# stepno is sequential only within each job, so strictly
 	# speaking this is not really a valid comparison: we will
 	# usually be comparing failed steps in different jobs.  But