summaryrefslogtreecommitdiff
path: root/jcstress-generate-html-report.py
diff options
context:
space:
mode:
authorAndrew McDermott <andrew.mcdermott@linaro.org>2014-07-01 14:23:43 +0100
committerAndrew McDermott <andrew.mcdermott@linaro.org>2014-07-01 14:24:30 +0100
commitbc6b07e39a47db21bdc260adcc20baebfe1cc13e (patch)
tree4f4f8e2272fe103ba17e4261e9e552c50f8d2fcd /jcstress-generate-html-report.py
parentdd6e012ba447bebb174b8178992713857e79f828 (diff)
jcstress-generate-html-report: print pass/fail rate
Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
Diffstat (limited to 'jcstress-generate-html-report.py')
-rwxr-xr-xjcstress-generate-html-report.py27
1 files changed, 12 insertions, 15 deletions
diff --git a/jcstress-generate-html-report.py b/jcstress-generate-html-report.py
index 73c59ec..9a6ab16 100755
--- a/jcstress-generate-html-report.py
+++ b/jcstress-generate-html-report.py
@@ -20,24 +20,16 @@
from htmltags import *
import argparse
+import csv
import os
import platform
-import csv
-import sys
import time
from datetime import datetime
+from common import *
def remove_starting_path(full_path, start):
return os.path.relpath(full_path, start)
-def cell_style(status):
- if 'success' in status:
- return status.upper()
- elif 'failed' in status:
- return status.upper()
- else:
- return None
-
parser = argparse.ArgumentParser()
parser.add_argument('--results', help='results filename', type=str, required=True)
parser.add_argument('--top-dir', help="top directory", type=str, required=True)
@@ -46,25 +38,30 @@ args = parser.parse_args()
head = HEAD(TITLE("jcstress Result Archive ({})".format(platform.machine())))
head <= LINK(rel="stylesheet", href="style.css")
body = BODY()
+
+body <= P("""This page captures the historic results of
+running the {} tests on {}.""".format(A("jcstress", href="http://openjdk.java.net/projects/code-tools/jcstress/"), platform.machine()))
+
table = TABLE(border=1)
-table <= TR(TH('Date') + TH('Results') + TH('Status'))
+table <= TR(TH('Date') + TH('JVM') + TH('Run Mode') + TH('Pass Rate'))
with open(args.results, 'rb') as csvfile:
rdr = csv.reader(csvfile, delimiter=',', quotechar='|')
for row in rdr:
human_readable_date = time.strftime("%Y-%m-%d", time.localtime(int(row[0]))).lower()
- human_readable_index = os.path.join(remove_starting_path(row[1], args.top_dir), 'results')
index_html = os.path.join(os.path.sep, remove_starting_path(row[1], args.top_dir), 'results', 'index.html')
html_row = TR()
+ pass_fail = pass_fail_rate("{}/results/index.html".format(row[1]))
html_row <= TD(human_readable_date)
- html_row <= TD(A(human_readable_index, href=index_html))
- html_row <= TD(row[2], Class=cell_style(row[2]))
+ html_row <= TD('server-release') # XXX remove hard-coded nature
+ html_row <= TD('sanity') # XXX remove hard-coded nature
+ html_row <= TD(A("{}/{}".format(pass_fail[0], pass_fail[1]), href=index_html), align='right')
table <= html_row
body <= H2("Historic Results")
body <= table
body <= HR()
-body <= P("Page generated on: {}".format(time.strftime("%Y-%m-%d %H:%M:%S %Z")))
+body <= P("Page generated on: {}".format(time.strftime("%a, %d %b %Y %T %z")))
head <= body
print HTML(head)