tweak output paths
authorJason Etheridge <jason@EquinoxInitiative.org>
Fri, 13 Dec 2019 06:16:34 +0000 (01:16 -0500)
committerJason Etheridge <jason@EquinoxInitiative.org>
Fri, 13 Dec 2019 06:16:34 +0000 (01:16 -0500)
so that the tests run in their permanent archive/ location and that RSS feeds
link to said locations

Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
qa/test.sh
qa/test_output_webifier.pl

index 11d96d5..b8a0a47 100755 (executable)
@@ -22,25 +22,31 @@ echo "*** Pushing installer script to $TARGET_USER@$TARGET_HOST:$TARGET_PATH"
 scp installer/stretch/installer_installer.sh $TARGET_USER@$TARGET_HOST:$TARGET_PATH || exit -1
 echo "*** Script pushed"
 
-echo "*** Archiving previous test run"
+echo "*** Location for new test run"
 cd $LOCAL_HTML_PATH || exit -1
-export ARCHIVE_DIR=`date +%Y-%m` || exit -1
-export ARCHIVE_SUBDIR=`date +%F_%T` || exit -1
-mkdir -p archive/$ARCHIVE_DIR/$ARCHIVE_SUBDIR || exit -1
-mv *.* archive/$ARCHIVE_DIR/$ARCHIVE_SUBDIR || exit -1
-cp archive/$ARCHIVE_DIR/$ARCHIVE_SUBDIR/*.hash . || exit -1
-echo "*** Test archived"
+export TEST_MAINDIR=`date +%Y-%m` || exit -1
+export TEST_SUBDIR=`date +%F_%T` || exit -1
+export TESTDIR=archive/$TEST_MAINDIR/$TEST_SUBDIR
+mkdir -p $TESTDIR || exit -1
+cp *.hash $TESTDIR || exit -1
+cp pass_fail.txt.prev $TESTDIR || exit -1
+echo "*** Location created"
 
 echo "*** Setting up new output"
+cp $LOCAL_QA_GIT_PATH/qa/test_output.css $TESTDIR
 cp $LOCAL_QA_GIT_PATH/qa/test_output.css .
-echo '<html><head></head><body><h1>Testing in progress</h1>[<a href="archive/">Previous Runs</a>]</body></html>' > test.html
-ln -s test.html index.html
+echo '<html><head></head><body><h1>Testing in progress</h1>[<a href="/">Previous Runs</a>]</body></html>' > test.html
+ln -s test.html $TESTDIR/index.html
+echo '<li><a href="'$TESTDIR'/index.html">'$TEST_SUBDIR'</a>' `cat index.html` > index.html
 echo "*** Ready to test!"
 
 echo -n "*** Test starting ... "
-ssh $TARGET_USER@$TARGET_HOST $TARGET_PATH/installer_installer.sh 2>&1 | tee output.txt
+ssh $TARGET_USER@$TARGET_HOST $TARGET_PATH/installer_installer.sh 2>&1 | tee $TESTDIR/output.txt
 echo "test run complete."
 
 echo "*** Creating web output"
+cd $TESTDIR
 $LOCAL_QA_GIT_PATH/qa/test_output_webifier.pl output.txt 
-
+cp test_rss.xml $LOCAL_HTML_PATH
+cp *.hash $LOCAL_HTML_PATH
+cp pass_fail.txt.prev $LOCAL_HTML_PATH
index e9a95cf..5527ea9 100755 (executable)
@@ -24,7 +24,7 @@ open  MAIN_PAGE, ">test.html";
 print MAIN_PAGE html_header('Test Output Summary');
 print MAIN_PAGE qq^[<a href="cronoutput.txt">test.sh output</a>]\n^;
 print MAIN_PAGE qq^[<a href="$ARGV[0]">installer_installer.sh output</a>]\n^;
-print MAIN_PAGE qq^[<a href="archive/">Previous Runs</a>]\n^;
+print MAIN_PAGE qq^[<a href="/">Previous Runs</a>]\n^;
 print MAIN_PAGE qq^[<a href="http://git.evergreen-ils.org/?p=working/random.git;a=shortlog;h=refs/heads/collab/phasefx/eg_live_tests">Git</a>]\n^;
 print MAIN_PAGE qq^[<a href="#first_failure">First Failure</a>]\n^;
 
@@ -334,6 +334,7 @@ sub branch_tips {
 }
 
 sub update_rss {
+    my $testdir = `pwd`; chomp $testdir; $testdir =~ s/.*public_html//;
     `touch pass_fail.txt.prev`;
     #if (`diff pass_fail.txt pass_fail.txt.prev`) {
         $fail = `grep Failed pass_fail.txt`;
@@ -356,7 +357,7 @@ sub update_rss {
      <entry>
        <title>Testing Success</title>
        <link href="http://testing.evergreen-ils.org/~live"/>
-       <id>http://testing.evergreen-ils.org/~live#^ . `date -Ins` . q^</id>
+       <id>http://testing.evergreen-ils.org/~live/^ . $testdir . q^/</id>
        <updated>^ . `date -Iseconds` . q^</updated>
        <summary>All tests succeeded</summary>
      </entry>
@@ -374,8 +375,8 @@ sub update_rss {
                print RSS_FILE q^
      <entry>
        <title>^ . $f_details . q^</title>
-       <link href="http://testing.evergreen-ils.org/~live/test.^ . $f_subpage_count . q^.html#^ . `date -Ins` . '-' . ($fidx++) . q^"/>
-       <id>http://testing.evergreen-ils.org/~live/test.^ . $f_subpage_count . q^.html#^ . `date -Ins` . '-' . ($fidx++) . q^</id>
+       <link href="http://testing.evergreen-ils.org/~live/^ . $testdir . q^/test.^ . $f_subpage_count . q^.html"/>
+       <id>http://testing.evergreen-ils.org/~live/^ . $testdir . q^/test.^ . $f_subpage_count . q^.html</id>
        <updated>^ . `date -Iseconds` . q^</updated>
        <summary>^ . $f_details . q^</summary>
      </entry>