From 738922a6cc57ccdd8d55a791b09debded48fa6e9 Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Wed, 10 Feb 2021 17:18:43 -0600 Subject: [PATCH 01/10] Added Failed Test Brief Log --- common/prettify.pm | 177 ++++++++++++++++++++++++++++++++++++++++++++- scoreboard.pl | 4 +- 2 files changed, 177 insertions(+), 4 deletions(-) diff --git a/common/prettify.pm b/common/prettify.pm index 926001224..90411561b 100644 --- a/common/prettify.pm +++ b/common/prettify.pm @@ -353,6 +353,176 @@ sub Normal ($) ############################################################################### ############################################################################### +package Prettify::Failed_Tests_HTML; + +use strict; +use warnings; + +use FileHandle; + +############################################################################### + +sub new ($) +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + my $basename = shift; + my $buildname = shift; + + my $path = substr($basename, 0, index($basename, '/')); + my $filename = $path . "/Failed_Tests.html"; + + $basename =~ s/^.*\///; + + $self->{FULLHTML} = $basename . "_Full.html"; + $self->{ERROR_COUNTER} = 0; + $self->{WARNING_COUNTER} = 0; + $self->{SECTION_COUNTER} = 0; + $self->{SUBSECTION_COUNTER} = 0; + $self->{TITLE} = "Failed Test Brief Log"; + + unless (-e $filename) { + my $file_handle = new FileHandle ($filename, 'w'); + print {$file_handle} "

$self->{TITLE}

\n"; + } + + $self->{FH} = new FileHandle ($filename, '>>'); + $self->{FILENAME} = $filename; + $self->{BUILDNAME} = $buildname; + + bless ($self, $class); + return $self; +} + +sub Header () +{ + my $self = shift; + print {$self->{FH}} "\n"; + print {$self->{FH}} "\n"; +} + +sub Footer () +{ + my $self = shift; + + # In the case where there was no errors or warnings, output a note + if ($self->{ERROR_COUNTER} == 0 && $self->{WARNING_COUNTER} == 0) { + print {$self->{FH}} "No Errors or Warnings detected
\n"; + } + + print {$self->{FH}} "\n"; + print {$self->{FH}} "\n"; +} + +sub Section ($) +{ + my $self = shift; + my $s = shift; + + # Escape any '<' or '>' signs + $s =~ s//>/g; + + my $counter = ++$self->{SECTION_COUNTER}; + + # Save for later use + + $self->{LAST_SECTION} = $s; +} + +sub Description ($) +{ + my $self = shift; + + # Ignore +} + +sub Timestamp ($) +{ + my $self = shift; + # Ignore +} + +sub Subsection ($) +{ + my $self = shift; + my $s = shift; + + # Escape any '<' or '>' signs + $s =~ s//>/g; + + my $counter = ++$self->{SUBSECTION_COUNTER}; + + # Save for later use + + $self->{LAST_SUBSECTION} = $s; +} + +sub Print_Sections () +{ + my $self = shift; + + if (defined $self->{LAST_SECTION} && defined $self->{LAST_SUBSECTION} && $self->{LAST_SECTION} eq 'Test') { + if (defined $self->{BUILDNAME}) { + print {$self->{FH}} "

$self->{BUILDNAME}


\n"; + $self->{BUILDNAME} = undef; + } + print {$self->{FH}} "{SUBSECTION_COUNTER}\">"; + print {$self->{FH}} "

$self->{LAST_SUBSECTION}

\n"; + $self->{LAST_SUBSECTION} = undef; + } +} + +sub Error ($) +{ + my $self = shift; + my $s = shift; + + # Escape any '<' or '>' signs + $s =~ s//>/g; + + my $counter = ++$self->{ERROR_COUNTER}; + + $self->Print_Sections (); + + print {$self->{FH}} "\n"; + print {$self->{FH}} "[{FULLHTML}#error_$counter" + . "\">Details] "; + print {$self->{FH}} "$s
\n"; +} + +sub Warning ($) +{ + my $self = shift; + my $s = shift; + + # Escape any '<' or '>' signs + $s =~ s//>/g; + + my $counter = ++$self->{WARNING_COUNTER}; + + $self->Print_Sections (); + + print {$self->{FH}} "\n"; + print {$self->{FH}} "[{FULLHTML}#warning_$counter" + . "\">Details] "; + print {$self->{FH}} "$s
\n"; +} + +sub Normal ($) +{ + my $self = shift; + + # Ignore +} + +############################################################################### +############################################################################### + package Prettify::JUnit; use strict; @@ -868,6 +1038,7 @@ sub new ($) my $class = ref ($proto) || $proto; my $self = {}; my $basename = shift; + my $buildname = shift; # Initialize some variables @@ -896,6 +1067,7 @@ sub new ($) new Prettify::Brief_HTML ($basename), new Prettify::Totals_HTML ($basename), #Must be 2 new Prettify::Config_HTML ($basename), #Must be 3 + new Prettify::Failed_Tests_HTML ($basename, $buildname), ); my $junit = main::GetVariable ('junit_xml_output'); @@ -1505,13 +1677,14 @@ sub BuildErrors ($) # In this function we process the log file line by line, # looking for errors. -sub Process ($) +sub Process ($$) { my $filename = shift; my $basename = $filename; $basename =~ s/\.txt$//; + my $buildname = shift; - my $processor = new Prettify ($basename); + my $processor = new Prettify ($basename, $buildname); my $input = new FileHandle ($filename, 'r'); diff --git a/scoreboard.pl b/scoreboard.pl index cf6b5203e..f289a77ae 100755 --- a/scoreboard.pl +++ b/scoreboard.pl @@ -539,7 +539,7 @@ ($) } print " Prettifying\n" if($verbose); - Prettify::Process ("$directory/$buildname/$filename"); + Prettify::Process ("$directory/$buildname/$filename", $buildname); } } } @@ -653,7 +653,7 @@ ($) if ( -e $file . "_Totals.html" ) {next;} if ( $post == 1 ) { print " Prettifying $file.txt\n" if($verbose); - Prettify::Process ("$file.txt"); + Prettify::Process ("$file.txt", $buildname); $updated++; } else { # Create the triggerfile for the next time we run From 012cc9a1a32b5d58ccbfddf0e23f63265798903a Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Thu, 11 Feb 2021 15:59:54 -0600 Subject: [PATCH 02/10] added git rev# to failed test log --- common/prettify.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/prettify.pm b/common/prettify.pm index 90411561b..353a3c219 100644 --- a/common/prettify.pm +++ b/common/prettify.pm @@ -381,6 +381,7 @@ sub new ($) $self->{SECTION_COUNTER} = 0; $self->{SUBSECTION_COUNTER} = 0; $self->{TITLE} = "Failed Test Brief Log"; + $self->{GIT_CHECKEDOUT_OPENDDS} = "unknown"; unless (-e $filename) { my $file_handle = new FileHandle ($filename, 'w'); @@ -466,9 +467,11 @@ sub Print_Sections () if (defined $self->{LAST_SECTION} && defined $self->{LAST_SUBSECTION} && $self->{LAST_SECTION} eq 'Test') { if (defined $self->{BUILDNAME}) { - print {$self->{FH}} "

$self->{BUILDNAME}


\n"; + print {$self->{FH}} "

$self->{BUILDNAME}

\n"; + print {$self->{FH}} "Rev: $self->{GIT_CHECKEDOUT_OPENDDS}
\n"; $self->{BUILDNAME} = undef; } + print {$self->{FH}} "{SUBSECTION_COUNTER}\">"; print {$self->{FH}} "

$self->{LAST_SUBSECTION}

\n"; $self->{LAST_SUBSECTION} = undef; @@ -1067,7 +1070,7 @@ sub new ($) new Prettify::Brief_HTML ($basename), new Prettify::Totals_HTML ($basename), #Must be 2 new Prettify::Config_HTML ($basename), #Must be 3 - new Prettify::Failed_Tests_HTML ($basename, $buildname), + new Prettify::Failed_Tests_HTML ($basename, $buildname), #Must be 4 ); my $junit = main::GetVariable ('junit_xml_output'); @@ -1283,6 +1286,7 @@ sub Setup_Handler ($) } my $totals= (@{$self->{OUTPUT}})[2]; + my $failed_test= (@{$self->{OUTPUT}})[4]; if ($s =~ m/Executing: (?:.*\/)?cvs(?:.exe)? /i) ## Prismtech still use some CVS please leave { @@ -1414,6 +1418,7 @@ sub Setup_Handler ($) elsif ("$totals->{GIT_CHECKEDOUT_OPENDDS}" eq "Matched") { $totals->{GIT_CHECKEDOUT_OPENDDS} = $sha; + $failed_test->{GIT_CHECKEDOUT_OPENDDS} = $sha; } $self->Output_Normal ($s); } @@ -1488,6 +1493,7 @@ sub Config_Handler ($) $outputs[3]->Normal($s, $state); my $totals= (@{$self->{OUTPUT}})[2]; + my $failed_tests= (@{$self->{OUTPUT}})[4]; if ($s =~ m/SVN_REVISION(_(\d))?=(\d+)/) { @@ -1544,6 +1550,7 @@ sub Config_Handler ($) my $revision = $totals->{GIT_REVISIONS}[0]; print "Matched GIT url to revision $revision\n"; $totals->{GIT_CHECKEDOUT_OPENDDS} = $revision; + $failed_tests->{GIT_CHECKEDOUT_OPENDDS} = $revision; } } elsif ($s =~ m/GIT_COMMIT=(.+)/) From d9af70fcdf57856221bf7cca0882584602f0c8e2 Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Fri, 12 Feb 2021 09:35:57 -0600 Subject: [PATCH 03/10] Added link to Index. Minor fix. --- common/prettify.pm | 3 ++- scoreboard.pl | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/prettify.pm b/common/prettify.pm index 353a3c219..8d58200dc 100644 --- a/common/prettify.pm +++ b/common/prettify.pm @@ -468,7 +468,8 @@ sub Print_Sections () if (defined $self->{LAST_SECTION} && defined $self->{LAST_SUBSECTION} && $self->{LAST_SECTION} eq 'Test') { if (defined $self->{BUILDNAME}) { print {$self->{FH}} "

$self->{BUILDNAME}

\n"; - print {$self->{FH}} "Rev: $self->{GIT_CHECKEDOUT_OPENDDS}
\n"; + my $rev = substr($self->{GIT_CHECKEDOUT_OPENDDS}, 0, 8); + print {$self->{FH}} "Rev: $rev
\n"; $self->{BUILDNAME} = undef; } diff --git a/scoreboard.pl b/scoreboard.pl index f289a77ae..ef2188fed 100755 --- a/scoreboard.pl +++ b/scoreboard.pl @@ -151,6 +151,7 @@ ($$) ### Print timestamp + print $indexhtml "
Failed Test Brief Log
\n"; print $indexhtml '
Last updated at ' . get_time_str() . "
\n"; ### Print the Footer @@ -1138,6 +1139,7 @@ ($$$) ### Print timestamp + print $indexhtml "
Failed Test Brief Log
\n"; print $indexhtml '
Last updated at ' . get_time_str() . "
\n"; ### Print the Footer From 71a5082a18def22055d2705b41064bf46d812c7b Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Mon, 15 Feb 2021 11:02:44 -0600 Subject: [PATCH 04/10] Added cleanup --- scoreboard.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scoreboard.pl b/scoreboard.pl index ef2188fed..13997ebb8 100755 --- a/scoreboard.pl +++ b/scoreboard.pl @@ -829,6 +829,11 @@ ($) } } } + + my $failed_tests = $directory . "/Failed_Tests.html"; + if (-e $failed_tests) { + unlink $failed_tests; + } } sub numerically { $a <=> $b } From c188ed4c78d54907247b9ff683f59ce28519541c Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Mon, 15 Feb 2021 11:29:25 -0600 Subject: [PATCH 05/10] another cleanup added --- scoreboard.pl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scoreboard.pl b/scoreboard.pl index 13997ebb8..b517d5914 100755 --- a/scoreboard.pl +++ b/scoreboard.pl @@ -568,6 +568,11 @@ ($) return; } + my $failed_tests = $directory . "/Failed_Tests.html"; + if (-e $failed_tests) { + unlink $failed_tests; + } + foreach my $buildname (keys %builds) { my $keep = $keep_default; my @existing; @@ -780,6 +785,11 @@ ($) return; } + my $failed_tests = $directory . "/Failed_Tests.html"; + if (-e $failed_tests) { + unlink $failed_tests; + } + foreach my $buildname (keys %builds) { ### Do we use the local cache or do we work ### with the storage of the build itself? @@ -829,11 +839,6 @@ ($) } } } - - my $failed_tests = $directory . "/Failed_Tests.html"; - if (-e $failed_tests) { - unlink $failed_tests; - } } sub numerically { $a <=> $b } From 6e61dddcd9db368e6d00ef6606e1420378359f1d Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Tue, 16 Feb 2021 12:24:43 -0600 Subject: [PATCH 06/10] Made failed test report optional --- common/prettify.pm | 26 ++++++++++++++++++-------- scoreboard.pl | 8 +++++--- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/common/prettify.pm b/common/prettify.pm index 8d58200dc..53b289935 100644 --- a/common/prettify.pm +++ b/common/prettify.pm @@ -1036,13 +1036,14 @@ use FileHandle; ############################################################################### -sub new ($) +sub new ($$$$) { my $proto = shift; my $class = ref ($proto) || $proto; my $self = {}; my $basename = shift; my $buildname = shift; + my $skip_failed_test_logs = shift; # Initialize some variables @@ -1071,8 +1072,11 @@ sub new ($) new Prettify::Brief_HTML ($basename), new Prettify::Totals_HTML ($basename), #Must be 2 new Prettify::Config_HTML ($basename), #Must be 3 - new Prettify::Failed_Tests_HTML ($basename, $buildname), #Must be 4 ); + + if (!$skip_failed_test_logs) { + push @{$self->{OUTPUT}}, new Prettify::Failed_Tests_HTML ($basename, $buildname); #Must be 4, if used + } my $junit = main::GetVariable ('junit_xml_output'); if (defined $junit) { @@ -1287,7 +1291,6 @@ sub Setup_Handler ($) } my $totals= (@{$self->{OUTPUT}})[2]; - my $failed_test= (@{$self->{OUTPUT}})[4]; if ($s =~ m/Executing: (?:.*\/)?cvs(?:.exe)? /i) ## Prismtech still use some CVS please leave { @@ -1419,7 +1422,11 @@ sub Setup_Handler ($) elsif ("$totals->{GIT_CHECKEDOUT_OPENDDS}" eq "Matched") { $totals->{GIT_CHECKEDOUT_OPENDDS} = $sha; - $failed_test->{GIT_CHECKEDOUT_OPENDDS} = $sha; + if (exists ($self->{OUTPUT}[4])) + { + (@{$self->{OUTPUT}})[4]->{GIT_CHECKEDOUT_OPENDDS} = $sha; + } + } $self->Output_Normal ($s); } @@ -1494,7 +1501,6 @@ sub Config_Handler ($) $outputs[3]->Normal($s, $state); my $totals= (@{$self->{OUTPUT}})[2]; - my $failed_tests= (@{$self->{OUTPUT}})[4]; if ($s =~ m/SVN_REVISION(_(\d))?=(\d+)/) { @@ -1551,7 +1557,10 @@ sub Config_Handler ($) my $revision = $totals->{GIT_REVISIONS}[0]; print "Matched GIT url to revision $revision\n"; $totals->{GIT_CHECKEDOUT_OPENDDS} = $revision; - $failed_tests->{GIT_CHECKEDOUT_OPENDDS} = $revision; + if (exists ($self->{OUTPUT}[4])) + { + (@{$self->{OUTPUT}})[4]->{GIT_CHECKEDOUT_OPENDDS} = $revision; + } } } elsif ($s =~ m/GIT_COMMIT=(.+)/) @@ -1685,14 +1694,15 @@ sub BuildErrors ($) # In this function we process the log file line by line, # looking for errors. -sub Process ($$) +sub Process ($$$) { my $filename = shift; my $basename = $filename; $basename =~ s/\.txt$//; my $buildname = shift; + my $skip_failed_test_logs = shift; - my $processor = new Prettify ($basename, $buildname); + my $processor = new Prettify ($basename, $buildname, $skip_failed_test_logs); my $input = new FileHandle ($filename, 'r'); diff --git a/scoreboard.pl b/scoreboard.pl index b517d5914..885832484 100755 --- a/scoreboard.pl +++ b/scoreboard.pl @@ -540,7 +540,7 @@ ($) } print " Prettifying\n" if($verbose); - Prettify::Process ("$directory/$buildname/$filename", $buildname); + Prettify::Process ("$directory/$buildname/$filename", $buildname, $use_build_logs); } } } @@ -659,7 +659,7 @@ ($) if ( -e $file . "_Totals.html" ) {next;} if ( $post == 1 ) { print " Prettifying $file.txt\n" if($verbose); - Prettify::Process ("$file.txt", $buildname); + Prettify::Process ("$file.txt", $buildname, $use_build_logs); $updated++; } else { # Create the triggerfile for the next time we run @@ -1149,7 +1149,9 @@ ($$$) ### Print timestamp - print $indexhtml "
Failed Test Brief Log
\n"; + if (!$use_build_logs) { + print $indexhtml "
Failed Test Brief Log
\n"; + } print $indexhtml '
Last updated at ' . get_time_str() . "
\n"; ### Print the Footer From 6011e0debd590bbaa4435ed6c616c886a78512c5 Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Tue, 16 Feb 2021 14:04:43 -0600 Subject: [PATCH 07/10] bug fix --- common/prettify.pm | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/common/prettify.pm b/common/prettify.pm index 53b289935..361ec231d 100644 --- a/common/prettify.pm +++ b/common/prettify.pm @@ -484,18 +484,21 @@ sub Error ($) my $self = shift; my $s = shift; - # Escape any '<' or '>' signs - $s =~ s//>/g; + if (defined $self->{LAST_SECTION} && $self->{LAST_SECTION} eq 'Test') { - my $counter = ++$self->{ERROR_COUNTER}; + # Escape any '<' or '>' signs + $s =~ s//>/g; - $self->Print_Sections (); + my $counter = ++$self->{ERROR_COUNTER}; - print {$self->{FH}} "\n"; - print {$self->{FH}} "[{FULLHTML}#error_$counter" - . "\">Details] "; - print {$self->{FH}} "$s
\n"; + $self->Print_Sections (); + + print {$self->{FH}} "\n"; + print {$self->{FH}} "[{FULLHTML}#error_$counter" + . "\">Details] "; + print {$self->{FH}} "$s
\n"; + } } sub Warning ($) @@ -503,18 +506,20 @@ sub Warning ($) my $self = shift; my $s = shift; - # Escape any '<' or '>' signs - $s =~ s//>/g; + if (defined $self->{LAST_SECTION} && $self->{LAST_SECTION} eq 'Test') { + # Escape any '<' or '>' signs + $s =~ s//>/g; - my $counter = ++$self->{WARNING_COUNTER}; + my $counter = ++$self->{WARNING_COUNTER}; - $self->Print_Sections (); + $self->Print_Sections (); - print {$self->{FH}} "\n"; - print {$self->{FH}} "[{FULLHTML}#warning_$counter" - . "\">Details] "; - print {$self->{FH}} "$s
\n"; + print {$self->{FH}} "\n"; + print {$self->{FH}} "[{FULLHTML}#warning_$counter" + . "\">Details] "; + print {$self->{FH}} "$s
\n"; + } } sub Normal ($) From a871551e97644c5983ec8191ddf3be9782d61c5d Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Tue, 16 Feb 2021 14:11:23 -0600 Subject: [PATCH 08/10] bug fix --- common/prettify.pm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/common/prettify.pm b/common/prettify.pm index 361ec231d..77ad08db3 100644 --- a/common/prettify.pm +++ b/common/prettify.pm @@ -399,21 +399,26 @@ sub new ($) sub Header () { my $self = shift; - print {$self->{FH}} "\n"; - print {$self->{FH}} "\n"; + + if (defined $self->{LAST_SECTION} && $self->{LAST_SECTION} eq 'Test') { + print {$self->{FH}} "\n"; + print {$self->{FH}} "\n"; + } } sub Footer () { my $self = shift; - # In the case where there was no errors or warnings, output a note - if ($self->{ERROR_COUNTER} == 0 && $self->{WARNING_COUNTER} == 0) { - print {$self->{FH}} "No Errors or Warnings detected
\n"; - } + if (defined $self->{LAST_SECTION} && $self->{LAST_SECTION} eq 'Test') { + # In the case where there was no errors or warnings, output a note + if ($self->{ERROR_COUNTER} == 0 && $self->{WARNING_COUNTER} == 0) { + print {$self->{FH}} "No Errors or Warnings detected
\n"; + } - print {$self->{FH}} "\n"; - print {$self->{FH}} "\n"; + print {$self->{FH}} "\n"; + print {$self->{FH}} "\n"; + } } sub Section ($) From 4c004ec6cd945d23cfd07dc7281d187bda32a3d1 Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Wed, 17 Feb 2021 09:17:31 -0600 Subject: [PATCH 09/10] Added rev link --- common/prettify.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/prettify.pm b/common/prettify.pm index 77ad08db3..5b0d1fff3 100644 --- a/common/prettify.pm +++ b/common/prettify.pm @@ -474,7 +474,9 @@ sub Print_Sections () if (defined $self->{BUILDNAME}) { print {$self->{FH}} "

$self->{BUILDNAME}

\n"; my $rev = substr($self->{GIT_CHECKEDOUT_OPENDDS}, 0, 8); - print {$self->{FH}} "Rev: $rev
\n"; + if ($rev ne "unknown") { + print {$self->{FH}} "Rev: $rev
\n"; + } $self->{BUILDNAME} = undef; } From 12ffa92976002d0b306edde3974781a8e53ece95 Mon Sep 17 00:00:00 2001 From: Mike Kuznetsov Date: Wed, 17 Feb 2021 12:17:57 -0600 Subject: [PATCH 10/10] use rev link from xml file --- common/prettify.pm | 14 +++++++++----- scoreboard.pl | 45 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/common/prettify.pm b/common/prettify.pm index 5b0d1fff3..de411063e 100644 --- a/common/prettify.pm +++ b/common/prettify.pm @@ -369,6 +369,7 @@ sub new ($) my $self = {}; my $basename = shift; my $buildname = shift; + my $rev_link = shift; my $path = substr($basename, 0, index($basename, '/')); my $filename = $path . "/Failed_Tests.html"; @@ -382,6 +383,7 @@ sub new ($) $self->{SUBSECTION_COUNTER} = 0; $self->{TITLE} = "Failed Test Brief Log"; $self->{GIT_CHECKEDOUT_OPENDDS} = "unknown"; + $self->{REV_LINK} = $rev_link; unless (-e $filename) { my $file_handle = new FileHandle ($filename, 'w'); @@ -475,7 +477,7 @@ sub Print_Sections () print {$self->{FH}} "

$self->{BUILDNAME}

\n"; my $rev = substr($self->{GIT_CHECKEDOUT_OPENDDS}, 0, 8); if ($rev ne "unknown") { - print {$self->{FH}} "Rev: $rev
\n"; + print {$self->{FH}} "Rev: {REV_LINK}>$rev
\n"; } $self->{BUILDNAME} = undef; } @@ -1048,7 +1050,7 @@ use FileHandle; ############################################################################### -sub new ($$$$) +sub new ($$$$$) { my $proto = shift; my $class = ref ($proto) || $proto; @@ -1056,6 +1058,7 @@ sub new ($$$$) my $basename = shift; my $buildname = shift; my $skip_failed_test_logs = shift; + my $rev_link = shift; # Initialize some variables @@ -1087,7 +1090,7 @@ sub new ($$$$) ); if (!$skip_failed_test_logs) { - push @{$self->{OUTPUT}}, new Prettify::Failed_Tests_HTML ($basename, $buildname); #Must be 4, if used + push @{$self->{OUTPUT}}, new Prettify::Failed_Tests_HTML ($basename, $buildname, $rev_link); #Must be 4, if used } my $junit = main::GetVariable ('junit_xml_output'); @@ -1706,15 +1709,16 @@ sub BuildErrors ($) # In this function we process the log file line by line, # looking for errors. -sub Process ($$$) +sub Process ($$$$) { my $filename = shift; my $basename = $filename; $basename =~ s/\.txt$//; my $buildname = shift; my $skip_failed_test_logs = shift; + my $rev_link = shift; - my $processor = new Prettify ($basename, $buildname, $skip_failed_test_logs); + my $processor = new Prettify ($basename, $buildname, $skip_failed_test_logs, $rev_link); my $input = new FileHandle ($filename, 'r'); diff --git a/scoreboard.pl b/scoreboard.pl index 885832484..c69fe05b5 100755 --- a/scoreboard.pl +++ b/scoreboard.pl @@ -540,7 +540,27 @@ ($) } print " Prettifying\n" if($verbose); - Prettify::Process ("$directory/$buildname/$filename", $buildname, $use_build_logs); + + my $diffRev = ''; + if (defined $builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS} && + !($builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS} =~ /None/)) { + $diffRev = $builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS}; + } + else { + $diffRev = 'None'; + } + my $diffRoot = $builds{$buildname}->{DIFFROOT}; + my $link = ''; + my $linktarget = ''; + if (defined $main::opt_n) { + $linktarget = "target=\"_blank\"" + } + # If we have a diff revision, and a diffroot URL, create a link + if (($diffRev !~ /None/) && ($diffRoot)) { + my $url = $diffRoot . $diffRev; + $link = "$diffRev"; + } + Prettify::Process ("$directory/$buildname/$filename", $buildname, $use_build_logs, $link); } } } @@ -659,7 +679,28 @@ ($) if ( -e $file . "_Totals.html" ) {next;} if ( $post == 1 ) { print " Prettifying $file.txt\n" if($verbose); - Prettify::Process ("$file.txt", $buildname, $use_build_logs); + + my $diffRev = ''; + if (defined $builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS} && + !($builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS} =~ /None/)) { + $diffRev = $builds{$buildname}->{SUBVERSION_CHECKEDOUT_OPENDDS}; + } + else { + $diffRev = 'None'; + } + my $diffRoot = $builds{$buildname}->{DIFFROOT}; + my $link = ''; + my $linktarget = ''; + if (defined $main::opt_n) { + $linktarget = "target=\"_blank\"" + } + # If we have a diff revision, and a diffroot URL, create a link + if (($diffRev !~ /None/) && ($diffRoot)) { + my $url = $diffRoot . $diffRev; + $link = "$diffRev"; + } + + Prettify::Process ("$file.txt", $buildname, $use_build_logs, $link); $updated++; } else { # Create the triggerfile for the next time we run