From 3e70ec380380d433cc2f178bf4a9e135466e3eff Mon Sep 17 00:00:00 2001 From: Dominic Hargreaves Date: Thu, 10 Sep 2015 14:26:51 +0100 Subject: [PATCH] jenkins_: Accumulate build result counts correctly The previous behaviour ignored initial statuses other than blue, yellow, red, disabled --- plugins/jenkins/jenkins_ | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/jenkins/jenkins_ b/plugins/jenkins/jenkins_ index d37c2605..7dd34068 100644 --- a/plugins/jenkins/jenkins_ +++ b/plugins/jenkins/jenkins_ @@ -79,7 +79,7 @@ my %states = ( 'aborted'=>'failing', 'aborted_anime'=>'failing' ); -my %counts = ('blue' => 0, 'yellow'=>0, 'red'=>0, 'disabled'=>0); +my %counts = ('stable' => 0, 'unstable'=>0, 'failing'=>0, 'disabled'=>0); if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { if( $type eq "results" ) { @@ -136,14 +136,14 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) { my $parsed = decode_json($result); foreach my $cur(@{$parsed->{'jobs'}}) { if (defined $states{$cur->{'color'}}) { - $counts{$cur->{'color'}} += 1; + $counts{$states{$cur->{'color'}}} += 1; } else { warn "Ignoring unknown color " . $cur->{'color'} . "\n" } } foreach my $status (keys %counts) { - print "build_$states{$status}.value $counts{$status}\n"; + print "build_$status.value $counts{$status}\n"; } exit; }