improved RSS feed
authorJason Etheridge <jason@esilibrary.com>
Tue, 16 Jan 2018 18:10:26 +0000 (13:10 -0500)
committerJason Etheridge <jason@esilibrary.com>
Tue, 16 Jan 2018 18:10:26 +0000 (13:10 -0500)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
qa/test_output_webifier.pl

index 66aeefb..fdfd210 100755 (executable)
@@ -166,10 +166,12 @@ sub print_pass_or_fail {
     #print "subpage = <$subpage> error_count = $error_count\n";
     if ($error_count && $error_count != $exception{$subpage} ) {
         print MAIN_PAGE ' - <span class="fail">Failed</span>';
+        print PASS_FAIL "Failed $subpage";
         if ($exception{$subpage} > 0) {
-            print MAIN_PAGE " - Expected $exception{$subpage} errors but encountered $error_count."
+            print MAIN_PAGE " - Expected $exception{$subpage} errors but encountered $error_count.";
+            print PASS_FAIL " - Expected $exception{$subpage} errors but encountered $error_count.";
         }
-        print PASS_FAIL "Failed\n";
+       print PASS_FAIL "\n";
     } else {
         if ($subpage_count) {
             print MAIN_PAGE ' - <span class="pass">Passed</span>';
@@ -221,16 +223,32 @@ sub update_rss {
      </author>
      <id>http://testing.evergreen-ils.org/~live</id>
 
+
+^;
+       if (!$fail) {
+               print RSS_FILE q^
      <entry>
-       <title>Test ^ . ($fail ? 'Failure' : 'Success') . q^</title>
+       <title>Testing Success</title>
        <link href="http://testing.evergreen-ils.org/~live"/>
        <id>http://testing.evergreen-ils.org/~live#^ . `date -Ins` . q^</id>
        <updated>^ . `date -Iseconds` . q^</updated>
-       <summary>^ . ($fail ? 'One or more tests failed' : 'All tests succeeded') . q^</summary>
+       <summary>All tests succeeded</summary>
      </entry>
-
-   </feed>
-^;
+               ^;
+       }
+       my $fidx = 0;
+       foreach my $f (split /\n/, $fail) {
+               print RSS_FILE q^
+     <entry>
+       <title>^ . $f . q^</title>
+       <link href="http://testing.evergreen-ils.org/~live"/>
+       <id>http://testing.evergreen-ils.org/~live#^ . `date -Ins` . '-' . ($fidx++) . q^</id>
+       <updated>^ . `date -Iseconds` . q^</updated>
+       <summary>^ . $f . q^</summary>
+     </entry>
+               ^;
+       }
+       print RSS_FILE '</feed>';
         close RSS_FILE;
     #}
     `mv pass_fail.txt pass_fail.txt.prev`;