regression_test.sh: WIP making html styles more enjoyable

Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This commit is contained in:
Jed Reynolds
2021-11-29 14:00:17 -08:00
parent ac936583da
commit cd397ec883

View File

@@ -20,12 +20,7 @@ Help()
echo "If using the help flag, put the H flag at the end of the command after other flags." echo "If using the help flag, put the H flag at the end of the command after other flags."
} }
if [ -d "/home/lanforge/lanforge_env" ]; if [ -d "/home/lanforge/lanforge_env"] && pip3 install --upgrade lanforge-scripts || pip3 install --user -r ../requirements.txt --upgrade
then
pip3 install --upgrade lanforge-scripts
else
pip3 install --user -r ../requirements.txt --upgrade
fi
while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do while getopts ":h:s:S:p:w:m:A:r:F:B:U:D:H:" option; do
case "${option}" in case "${option}" in
@@ -529,13 +524,13 @@ function test() {
STDERR="<a href=\"${URL2}/${NAME}_stderr.txt\" target=\"_blank\">STDERR</a>" STDERR="<a href=\"${URL2}/${NAME}_stderr.txt\" target=\"_blank\">STDERR</a>"
else else
echo "No errors detected" echo "No errors detected"
fi
results+=("<tr><td>${CURR_TEST_NAME}</td> results+=("<tr><td>${CURR_TEST_NAME}</td>
<td class='scriptdetails'>${testcommand}</td> <td class='scriptdetails'>${testcommand}</td>
<td class='${TEXTCLASS}'>${TDTEXT}</td> <td class='success'>Success</td>
<td>${execution}</td> <td>${execution}</td>
<td><a href=\"${URL2}/${NAME}.txt\" target=\"_blank\">STDOUT</a></td> <td><a href=\"${URL2}/${NAME}.txt\" target=\"_blank\">STDOUT</a></td>
<td>${STDERR}</td></tr>") <td></td></tr>")
fi
} }
function start_tests() { function start_tests() {
@@ -562,7 +557,8 @@ function start_tests() {
function html_generator() { function html_generator() {
LAST_COMMIT=$(git log --pretty=oneline | head -n 1) LAST_COMMIT=$(git log --pretty=oneline | head -n 1)
header="<html> header="<!DOCTYPE html>
<html>
<head> <head>
<title>Regression Test Results $NOW</title> <title>Regression Test Results $NOW</title>
<style> <style>
@@ -597,6 +593,7 @@ function html_generator() {
<h4>$NOW</h4> <h4>$NOW</h4>
<h4>$LAST_COMMIT</h4> <h4>$LAST_COMMIT</h4>
<table border ='1' id='myTable2'> <table border ='1' id='myTable2'>
<thead>
<tr> <tr>
<th onclick=\"sortTable('myTable2', 0)\">Command Name</th> <th onclick=\"sortTable('myTable2', 0)\">Command Name</th>
<th onclick=\"sortTable('myTable2', 1)\">Command</th> <th onclick=\"sortTable('myTable2', 1)\">Command</th>
@@ -604,9 +601,10 @@ function html_generator() {
<th onclick=\"sortTable('myTable2', 3)\">Execution time</th> <th onclick=\"sortTable('myTable2', 3)\">Execution time</th>
<th onclick=\"sortTable('myTable2', 4)\">STDOUT</th> <th onclick=\"sortTable('myTable2', 4)\">STDOUT</th>
<th onclick=\"sortTable('myTable2', 5)\">STDERR</th> <th onclick=\"sortTable('myTable2', 5)\">STDERR</th>
</tr>" </tr>
tail="</body> </thead>
</html>" <tbody>"
tail="</body></html>"
fname="${HOMEPATH}/html-reports/regression_file-${NOW}.html" fname="${HOMEPATH}/html-reports/regression_file-${NOW}.html"
echo "$header" >> "$fname" echo "$header" >> "$fname"