summaryrefslogtreecommitdiff
path: root/framework
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 /framework
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>
Diffstat (limited to 'framework')
-rw-r--r--framework/summary.py48
1 files changed, 27 insertions, 21 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()