summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2013-05-03 16:02:02 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2013-05-31 14:11:21 -0700
commitfc25db9771b88a17c8f615d57bf47bd013efc4ca (patch)
tree7a6e64d942747dffac592179f4fa348d68c90b40
parent80f597632541ef2c178d2367602ca0e055526496 (diff)
HTML summary: Provides means to exclude generating test result files
This provides a switch and method for excluding the generation of the test result HTML files (those that live under <testrun name>/). This allows the user to trade some verbosity in the results for a significant increase in generation speed. A run of quick.tests with all options enabled takes ~5.5 seconds, with just pass and skip disabled it only takes ~2.5 seconds. This only becomes more significant as more testsruns are added the HTML page. V3: - Remove some bad comments - adds 'skip' to exclude list V4: - Renames --exclude-generation to --exclude-details Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com> Reviewed-By: Aaron Watry <awatry@gmail.com> Reviewed-By: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--framework/summary.py48
-rwxr-xr-xpiglit-summary-html.py17
-rw-r--r--templates/index.mako6
3 files changed, 49 insertions, 22 deletions
diff --git a/framework/summary.py b/framework/summary.py
index 503744066..2a5b74a37 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -682,7 +682,7 @@ class NewSummary:
if status[i] > 1 and status[i + 1] == 1:
self.fixes.append(test)
- def generateHTML(self, destination):
+ def generateHTML(self, destination, exclude):
"""
Produce HTML summaries.
@@ -727,25 +727,29 @@ class NewSummary:
for key, value in each.tests.iteritems():
tPath = path.join(destination, each.name, path.dirname(key))
- # os.makedirs is very annoying, it throws an OSError if the
- # path requested already exists, so do this check to ensure
- # that it doesn't
- if not path.exists(tPath):
- os.makedirs(tPath)
-
- file = open(path.join(destination, each.name, key + ".html"),
- 'w')
- file.write(testfile.render(testname=key,
- status=value.get('result', 'None'),
- returncode=value.get('returncode',
+ if value['result'] not in exclude:
+ # os.makedirs is very annoying, it throws an OSError if
+ # the path requested already exists, so do this check to
+ # ensure that it doesn't
+ if not path.exists(tPath):
+ os.makedirs(tPath)
+
+ file = open(path.join(destination,
+ each.name,
+ key + ".html"), 'w')
+ file.write(testfile.render(testname=key,
+ status=value.get('result',
'None'),
- time=value.get('time', 'None'),
- info=value.get('info', 'None'),
- command=value.get('command',
- 'None'),
- css=path.relpath(resultCss, tPath),
- index=index))
- file.close()
+ returncode=value.get('returncode',
+ 'None'),
+ time=value.get('time', 'None'),
+ info=value.get('info', 'None'),
+ command=value.get('command',
+ 'None'),
+ css=path.relpath(resultCss,
+ tPath),
+ index=index))
+ file.close()
# Finally build the root html files: index, regressions, etc
index = Template(filename="templates/index.mako",
@@ -761,7 +765,8 @@ class NewSummary:
file = open(path.join(destination, "index.html"), 'w')
file.write(index.render(results=HTMLIndex(self, 'alltests'),
page='all',
- colnum=len(self.results)))
+ colnum=len(self.results),
+ exclude=exclude))
file.close()
# Generate the rest of the pages
@@ -769,5 +774,6 @@ class NewSummary:
file = open(path.join(destination, page + '.html'), 'w')
file.write(index.render(results=HTMLIndex(self, page),
page=page,
- colnum=len(self.results)))
+ colnum=len(self.results),
+ exclude=exclude))
file.close()
diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index 5ee10ec7d..65e6653a8 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -52,6 +52,17 @@ def main():
help = "Load a newline seperated list of results. "
"These results will be prepended to any "
"Results specified on the command line")
+ parser.add_argument("-e", "--exclude-details",
+ default = [],
+ action = "append",
+ choices = ['skip', 'pass', 'warn', 'crash' 'fail',
+ 'all'],
+ help = "Optionally exclude the generation of HTML"
+ "pages for individual test pages with the"
+ "status(es) given as arguments. This speeds"
+ "up HTML generation, but reduces the info"
+ "in the HTML pages. May be used multiple"
+ "times")
parser.add_argument("summaryDir",
metavar = "<Summary Directory>",
help = "Directory to put HTML files in")
@@ -65,6 +76,10 @@ def main():
if not args.list and not args.resultsFiles:
raise parser.error("Missing required option -l or <resultsFiles>")
+ # If exclude-results has all, then change it to be all
+ if 'all' in args.exclude_details:
+ args.exclude_details=['skip', 'pass', 'warn', 'crash', 'fail']
+
# if overwrite is requested delete the output directory
if path.exists(args.summaryDir) and args.overwrite:
shutil.rmtree(args.summaryDir)
@@ -78,7 +93,7 @@ def main():
# Create the HTML output
output = summary.NewSummary(args.resultsFiles)
- output.generateHTML(args.summaryDir)
+ output.generateHTML(args.summaryDir, args.exclude_details)
if __name__ == "__main__":
diff --git a/templates/index.mako b/templates/index.mako
index 2f6eedf4f..ea3ec7613 100644
--- a/templates/index.mako
+++ b/templates/index.mako
@@ -58,9 +58,15 @@
</td>
% elif line['type'] == "testResult":
<td class="${line['class']}">
+ ## If the result is in the excluded results page list from
+ ## argparse, just print the text, otherwise add the link
+ % if line['class'] not in exclude:
<a href="${line['href']}">
${line['text']}
</a>
+ % else:
+ ${line['text']}
+ % endif
</td>
% elif line['type'] == "subtestResult":
<td class="${line['class']}">