Show new and removed jobs

This commit is contained in:
Eelco Dolstra 2012-04-02 16:45:05 +02:00
parent 662cdf0421
commit 427e5e8db8
4 changed files with 34 additions and 17 deletions

View file

@ -33,14 +33,12 @@ sub view : Chained('eval') PathPart('') Args(0) {
my @builds = $eval->builds->search({}, { order_by => ["job", "system", "id"], columns => [@buildListColumns] });
my @builds2 = $eval2->builds->search({}, { order_by => ["job", "system", "id"], columns => [@buildListColumns] });
print STDERR "EVAL IS ", $eval2->id, "\n";
print STDERR scalar(@builds), "\n";
print STDERR scalar(@builds2), "\n";
$c->stash->{stillSucceed} = [];
$c->stash->{stillFail} = [];
$c->stash->{nowSucceed} = [];
$c->stash->{nowFail} = [];
$c->stash->{new} = [];
$c->stash->{removed} = [];
my $n = 0;
foreach my $build (@builds) {
@ -49,11 +47,8 @@ sub view : Chained('eval') PathPart('') Args(0) {
my $build2 = $builds2[$n];
my $d = $build->get_column('job') cmp $build2->get_column('job')
|| $build->get_column('system') cmp $build2->get_column('system');
#print STDERR $build->id, " ", $build->get_column('job'), " ", $build->system, " ", $d, "\n";
last if $d == -1;
if ($d == 0) {
#print STDERR $build->buildstatus, "\n";
#print STDERR $build2->buildstatus, "\n";
$n++;
if ($build->buildstatus == 0 && $build2->buildstatus == 0) {
push @{$c->stash->{stillSucceed}}, $build;
} elsif ($build->buildstatus != 0 && $build2->buildstatus != 0) {
@ -62,9 +57,13 @@ sub view : Chained('eval') PathPart('') Args(0) {
push @{$c->stash->{nowSucceed}}, $build;
} elsif ($build->buildstatus != 0 && $build2->buildstatus == 0) {
push @{$c->stash->{nowFail}}, $build;
}
} else { die; }
last;
} elsif ($d == -1) {
push @{$c->stash->{new}}, $build;
last;
}
push @{$c->stash->{removed}}, { job => $build2->get_column('job'), system => $build2->get_column('system') };
$n++;
}
}

View file

@ -1,7 +1,7 @@
[% WRAPPER layout.tt title="Bla" %]
[% WRAPPER layout.tt title="Jobset $project.name:$jobset.name evaluation $eval.id" %]
[% PROCESS common.tt %]
<h1>Jobset <tt>[% project.name %]:[% jobset.name %]</tt> Evaluation [% eval.id %]</h1>
<h1>Jobset <tt>[% project.name %]:[% jobset.name %]</tt> evaluation [% eval.id %]</h1>
<!-- <p>Info on evaluation [% eval.id %]...<p> -->
@ -16,23 +16,41 @@
[% INCLUDE renderBuildListHeader unsortable=1 %]
[% IF new.size > 0 %]
<tr><th class="subheader" colspan="0"><strong>New</strong> jobs</th></tr>
[% INCLUDE renderSome builds=new %]
[% END %]
[% IF removed.size > 0 %]
<tr><th class="subheader" colspan="0"><strong>Removed</strong> jobs</th></tr>
[%- FOREACH j IN removed -%]
<tr>
<td colspan=2></td>
<td>[% INCLUDE renderJobName project=project.name jobset=jobset.name job=j.job %]</td>
<td></td>
<td><tt>[% j.system %]</tt></td>
<td></td>
</tr>
[%- END -%]
[% END %]
[% IF nowFail.size > 0 %]
<tr><th class="subheader" colspan="0">Builds that now <strong>fail</strong></th></tr>
<tr><th class="subheader" colspan="0">Jobs that now <strong>fail</strong></th></tr>
[% INCLUDE renderSome builds=nowFail %]
[% END %]
[% IF nowSucceed.size > 0 %]
<tr><th class="subheader" colspan="0">Builds that now <strong>succeed</strong></th></tr>
<tr><th class="subheader" colspan="0">Jobs that now <strong>succeed</strong></th></tr>
[% INCLUDE renderSome builds=nowSucceed %]
[% END %]
[% IF stillFail.size > 0 %]
<tr><th class="subheader" colspan="0">Builds that still <strong>fail</strong></th></tr>
<tr><th class="subheader" colspan="0">Jobs that still <strong>fail</strong></th></tr>
[% INCLUDE renderSome builds=stillFail %]
[% END %]
[% IF stillSucceed.size > 0 %]
<tr><th class="subheader" colspan="0">Builds that still <strong>succeed</strong></th></tr>
<tr><th class="subheader" colspan="0">Jobs that still <strong>succeed</strong></th></tr>
[% INCLUDE renderSome builds=stillSucceed %]
[% END %]

View file

@ -1,4 +1,4 @@
[% WRAPPER layout.tt title="Jobset $project.name:$jobset.name evaluations" %]
[% WRAPPER layout.tt title="Jobset $project.name:$jobset.name Evaluations" %]
[% PROCESS common.tt %]
<h1>Evaluations of Jobset <tt>[% INCLUDE renderLink

View file

@ -28,7 +28,7 @@ a#error-link {
table {
empty-cells: show;
border-spacing: 1px;
border-collapse: collapse;
text-align: left;
}