Révision 3e70ec38
jenkins_: Accumulate build result counts correctly
The previous behaviour ignored initial statuses other than blue, yellow,
red, disabled
| plugins/jenkins/jenkins_ | ||
|---|---|---|
| 79 | 79 |
'aborted'=>'failing', |
| 80 | 80 |
'aborted_anime'=>'failing' |
| 81 | 81 |
); |
| 82 |
my %counts = ('blue' => 0, 'yellow'=>0, 'red'=>0, 'disabled'=>0);
|
|
| 82 |
my %counts = ('stable' => 0, 'unstable'=>0, 'failing'=>0, 'disabled'=>0);
|
|
| 83 | 83 |
|
| 84 | 84 |
if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
|
| 85 | 85 |
if( $type eq "results" ) {
|
| ... | ... | |
| 136 | 136 |
my $parsed = decode_json($result); |
| 137 | 137 |
foreach my $cur(@{$parsed->{'jobs'}}) {
|
| 138 | 138 |
if (defined $states{$cur->{'color'}}) {
|
| 139 |
$counts{$cur->{'color'}} += 1;
|
|
| 139 |
$counts{$states{$cur->{'color'}}} += 1;
|
|
| 140 | 140 |
} else {
|
| 141 | 141 |
warn "Ignoring unknown color " . $cur->{'color'} . "\n"
|
| 142 | 142 |
} |
| 143 | 143 |
} |
| 144 | 144 |
|
| 145 | 145 |
foreach my $status (keys %counts) {
|
| 146 |
print "build_$states{$status}.value $counts{$status}\n";
|
|
| 146 |
print "build_$status.value $counts{$status}\n";
|
|
| 147 | 147 |
} |
| 148 | 148 |
exit; |
| 149 | 149 |
} |
Formats disponibles : Unified diff