tweak output and debug output
authorJason Etheridge <jason@EquinoxInitiative.org>
Tue, 3 Dec 2019 20:28:22 +0000 (15:28 -0500)
committerJason Etheridge <jason@EquinoxInitiative.org>
Tue, 3 Dec 2019 20:28:22 +0000 (15:28 -0500)
Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
qa/test_output_webifier.pl

index f72567f..1757833 100755 (executable)
@@ -10,6 +10,7 @@ my $q = CGI->new;
 
 my $state = 'skipping';
 print DEBUG "state = $state\n";
+print STDOUT "state = $state\n";
 my $error_count = 0;
 my $subpage_return_value;
 my $subpage_count = 0;
@@ -55,6 +56,7 @@ sub open_subpage {
         $subpage_open = 1;
         $state = 'outputting';
         print DEBUG "state = $state\n";
+        print STDOUT "state = $state\n";
         print MAIN_PAGE qq^\n<li><a href="test.$subpage_count.html">$subpage</a>^;
         open  SUB_PAGE, ">test.$subpage_count.html";
         print SUB_PAGE html_header($subpage);
@@ -68,6 +70,8 @@ sub close_subpage {
         $subpage_open = 0;
         $state = 'skipping';
         print DEBUG "state = $state\n";
+        print STDOUT "state = $state\n";
+        print DEBUG "outputting $prev_subpage with error_count = $error_count\n";
         print STDOUT "outputting $prev_subpage with error_count = $error_count\n";
         print_pass_or_fail($subpage,$subpage_count,$error_count,$subpage_return_value);
         $error_count = 0;
@@ -76,41 +80,50 @@ sub close_subpage {
 
 sub consider_error_count_inc {
     my $line = shift;
+    print DEBUG "considering: $line";
+    #print STDOUT "considering: $line";
     if ($subpage eq 'Installing Evergreen pre-requisites') {
         if ($line =~ /taint mode on: skipping rc file/) {
             print DEBUG "error skipped, $error_count\n";
+            print STDOUT "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";
+            print STDOUT "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";
+            print STDOUT "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";
+            print STDOUT "error skipped, $error_count\n";
             return;
         }
         if ($line =~ /08-lp1366964-libdbi-error.t/) {
             print DEBUG "error skipped, $error_count\n";
+            print STDOUT "error skipped, $error_count\n";
             return;
         }
     }
     $error_count++;
     print DEBUG "error counted, $error_count\n";
+    print STDOUT "error counted, $error_count\n";
 }
 
 while (my $line = <>) {
     push @all_lines, $line;
     print DEBUG "$state -- $line";
+    #print STDOUT "$state -- $line";
     if ($line =~ /Tip of OpenSRF: (.*)/) {
         $opensrf_tip = $1;
     }
@@ -119,16 +132,19 @@ while (my $line = <>) {
     }
     if ($line =~ /__--== (.*)$/) {
         close_subpage();
+        print DEBUG "outputting section header $1\n";
         print STDOUT "outputting section header $1\n";
         print MAIN_PAGE "</ul><h1>$1</h1><ul>\n";
     }
     if ($line =~ /__--==2 (.*)$/) {
         close_subpage();
+        print DEBUG "outputting section header $1\n";
         print STDOUT "outputting section header $1\n";
         print MAIN_PAGE "</ul><h2>$1</h2><ul>\n";
     }
     if ($line =~ /__--==3 (.*)$/) {
         close_subpage();
+        print DEBUG "outputting section header $1\n";
         print STDOUT "outputting section header $1\n";
         print MAIN_PAGE "</ul><h3>$1</h3><ul>\n";
     }
@@ -202,6 +218,7 @@ while (my $line = <>) {
         close SUB_PAGE;
         $state = 'skipping';
         print DEBUG "state = $state\n";
+        print STDOUT "state = $state\n";
     }
 }
 close_subpage();