Undefined values don't need any special formatting so let the default implementation deal with them.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/web/JobDetails.pl | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index 748153f28..b0ef2a733 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -91,11 +91,11 @@ sub GenerateDataView($$$) my $PropertyName = $Col->{Descriptor}->GetName(); if ($PropertyName eq "VM") { - print "<a href='#k", $StepTask->GetKey(), "'>"; - print $self->escapeHTML($StepTask->VM->Name); - print "</a>"; + print "<a href='#k", $StepTask->GetKey(), "'>", + $self->escapeHTML($StepTask->VM->Name), "</a>"; + return; } - elsif ($PropertyName eq "FileName") + if ($PropertyName eq "FileName") { my $FileName = $StepTask->GetFullFileName(); if ($FileName and -r $FileName) @@ -105,12 +105,9 @@ sub GenerateDataView($$$) print "<a href='", $self->escapeHTML($URI), "'>", $self->escapeHTML($StepTask->FileName), "</a>"; } - else - { - $self->SUPER::GenerateDataView($Row, $Col); - } + return; } - elsif ($PropertyName eq "CmdLineArg") + if ($PropertyName eq "CmdLineArg") { my $Args = $self->escapeHTML($StepTask->CmdLineArg); if ($Args eq "" or $StepTask->VM->Type eq "wine") @@ -127,23 +124,15 @@ sub GenerateDataView($$$) } } print $Args; + return; } - elsif ($PropertyName eq "Ended") - { - if (defined $StepTask->Ended) - { - my $Duration = $StepTask->Ended - $StepTask->Started; - GenerateTipDateTime($StepTask->Ended, DurationToString($Duration)); - } - else - { - print " "; - } - } - else + if ($PropertyName eq "Ended" and defined $StepTask->Ended) { - $self->SUPER::GenerateDataView($Row, $Col); + my $Duration = $StepTask->Ended - $StepTask->Started; + GenerateTipDateTime($StepTask->Ended, DurationToString($Duration)); + return; } + $self->SUPER::GenerateDataView($Row, $Col); }
When there are a lot of tasks this makes it easier to identify and go to those that have failures.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- This also makes the presentation more consistent with the main index page. --- testbot/web/JobDetails.pl | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index b0ef2a733..99c68bcb8 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -132,6 +132,13 @@ sub GenerateDataView($$$) GenerateTipDateTime($StepTask->Ended, DurationToString($Duration)); return; } + if ($PropertyName eq "TestFailures" and defined $StepTask->TestFailures) + { + my $class = $StepTask->TestFailures ? "testfail" : "success"; + print "<a href='#k", $StepTask->GetKey(), "'><span class='$class'>", + $StepTask->TestFailures, "</span></a>"; + return; + } $self->SUPER::GenerateDataView($Row, $Col); }