From: Jason Etheridge Date: Thu, 21 Nov 2019 21:00:57 +0000 (-0500) Subject: alternate error exception handling for webifier X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a87e309870f0334621471f4c2fa54bc17f6e60f9;p=working%2Frandom.git alternate error exception handling for webifier Signed-off-by: Jason Etheridge --- diff --git a/qa/test_output_webifier.pl b/qa/test_output_webifier.pl index 476bf65eb..096fd912a 100755 --- a/qa/test_output_webifier.pl +++ b/qa/test_output_webifier.pl @@ -74,6 +74,40 @@ sub close_subpage { } } +sub consider_error_count_inc { + my $line = shift; + if ($subpage eq 'Installing Evergreen pre-requisites') { + if ($line =~ /taint mode on: skipping rc file/) { + print DEBUG "error skipped, $error_count\n"; + return; + } + } + if ($subpage eq 'Installing AngularJS web client') { + if ($line =~ /Error loading shared worker/) { + print DEBUG "error skipped, $error_count\n"; + return; + } + } + if ($subpage eq 'Installing OpenSRF') { + if ($line =~ /grep: \/etc\/apache2\/httpd.conf: No such file or directory/) { + print DEBUG "error skipped, $error_count\n"; + return; + } + } + if ($subpage eq 'Log Output: osrfsys.log') { + if ($line =~ /INSERT INTO config.copy_status \(holdable,id,name,opac_visible,copy_active,restrict_copy_delete,is_available\) VALUES \(DEFAULT,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT\);/) { + print DEBUG "error skipped, $error_count\n"; + return; + } + if ($line =~ /08-lp1366964-libdbi-error.t/) { + print DEBUG "error skipped, $error_count\n"; + return; + } + } + $error_count++; + print DEBUG "error counted, $error_count\n"; +} + while (my $line = <>) { push @all_lines, $line; print DEBUG "$state -- $line"; @@ -125,8 +159,7 @@ while (my $line = <>) { || $line =~ /No such file or directory/ ) { $class .= 'notok '; - $error_count++; - print DEBUG "error counted, $error_count\n"; + consider_error_count_inc($line); } if ($line =~ /^not ok/ && $line =~ /TODO/) { $class .= 'todo '; @@ -135,14 +168,12 @@ while (my $line = <>) { $class .= 'pass ' if ($line =~ /^Result: PASS/); if ($line =~ /^Result: FAIL/) { $class .= 'fail '; - $error_count++; - print DEBUG "error counted, $error_count\n"; + consider_error_count_inc($line); } if ($line =~ /^Return Value = (.+)$/) { $subpage_return_value = $1; if ($1 ne '0') { $class .= 'fail '; - $error_count++; print DEBUG "error counted, $error_count\n"; } } @@ -214,25 +245,21 @@ sub print_pass_or_fail { my $p_subpage_count = shift; my $p_error_count = shift; my $p_subpage_return_value = shift; - my $exception = {}; # keyed on subpage, value = # of expected errors - $exception{'Log Output: osrfsys.log'} = 3; # open-ils.cstore ERROR from live_t/08-lp1366964-libdbi-error.t (and related) - #$exception{'Running Evergreen browser client build/test'} = 6; # Cannot connect to offline DB: Error: http://google.github.io/lovefield/error_lookup/src/error_lookup.html - $exception{'Installing OpenSRF'} = 1 ; # grep: /etc/apache2/httpd.conf: No such file or directory - $exception{'Restarting Apache'} = 1 ; # There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand. ... (warning). - $exception{'Installing AngularJS web client'} = 6; # ERROR LOG: 'Error loading shared worker', Event{isTrusted: true} + my $expected_error_count = {}; # keyed on subpage, value = # of expected errors + $expected_error_count{'Installing Evergreen pre-requisites'} = 1; # Result: FAIL for Class-DBI-Frozen-301-3.0.1-Dd3c7H - if (! defined $exception{$p_subpage}) { - $exception{$p_subpage} = 0; + if (! defined $expected_error_count{$p_subpage}) { + $expected_error_count{$p_subpage} = 0; } # just consider the final Return Value for the following subpages: - if ($p_subpage eq 'Installing Evergreen pre-requisites') { - $p_error_count = 0; - if ($p_subpage_return_value ne '0') { - $p_error_count = 1; - } - } + #if ($p_subpage eq 'Installing Evergreen pre-requisites') { + # $p_error_count = 0; + # if ($p_subpage_return_value ne '0') { + # $p_error_count = 1; + # } + #} #print "subpage = <$p_subpage> error_count = $p_error_count\n"; - if ($p_error_count && $p_error_count != $exception{$p_subpage} ) { + if ($p_error_count && $p_error_count != $expected_error_count{$p_subpage} ) { if (!$first_failure) { $first_failure = 1; print MAIN_PAGE ' - Failed'; @@ -240,9 +267,9 @@ sub print_pass_or_fail { print MAIN_PAGE ' - Failed'; } print PASS_FAIL "$p_subpage_count $p_error_count Failed $p_subpage"; - if ($exception{$p_subpage} > 0) { - print MAIN_PAGE " - Expected $exception{$p_subpage} errors but encountered $p_error_count."; - print PASS_FAIL " - Expected $exception{$p_subpage} errors but encountered $p_error_count."; + if ($expected_error_count{$p_subpage} > 0) { + print MAIN_PAGE " - Expected $expected_error_count{$p_subpage} errors but encountered $p_error_count."; + print PASS_FAIL " - Expected $expected_error_count{$p_subpage} errors but encountered $p_error_count."; } print PASS_FAIL "\n"; } else {