summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-09-11 13:59:38 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2015-09-22 14:45:49 -0700
commite338988e69e1fa3c6b0a22dac68f1807c387a791 (patch)
treec8508a2fc6681ebd01a5d4c4d189deb0d5c53aa6 /framework
parent39edc6b8ff25131c601402d7977370a81876493b (diff)
framework/backends/json.py: don't resume if results.json.<comp> exists
If we aggregate a result the metadata.json will be left (just in case), and this code would ignore the results.json.<compression> and regenerate the results each time. That's expensive and useless. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/backends/json.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/framework/backends/json.py b/framework/backends/json.py
index 5eeab4448..353042227 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -183,18 +183,12 @@ def load_results(filename, compression_):
# file descriptors
if not os.path.isdir(filename):
filepath = filename
- elif os.path.exists(os.path.join(filename, 'metadata.json')):
- # If the test is still running we need to use the resume code, since
- # there will not be a results.json file.
- # We want to return here since the results are known current (there's
- # an assert in TestrunResult.load), and there is no filepath
- # to pass to update_results
- # XXX: This needs to be run before searching for a results.json file so
- # that if the new run is overwriting an old one we load the
- # partial and not the original. It might be better to just delete
- # the contents of the folder if there is anything in it.
- # XXX: What happens if the tests folder gets deleted in the middle of
- # this?
+ elif (os.path.exists(os.path.join(filename, 'metadata.json')) and
+ not os.path.exists(os.path.join(
+ filename, 'results.json.' + compression_))):
+ # We want to hit this path only if there isn't a
+ # results.json.<compressions>, since otherwise we'll continually
+ # regenerate values that we don't need to.
return _resume(filename)
else:
# Look for a compressed result first, then a bare result, finally for