Commit 4807eb9b authored by dpranke@chromium.org's avatar dpranke@chromium.org

Handle tries of results data in upload (fix _is_directory) for TestResultsServer

The file handler was getting confused when we would upload a full_results.json
that contained a "results" key that pointed to a trie of tests.

Also fix some file permissions issues that the presubmit check complained about.

R=ojan@chromium.org
BUG=403663
NOTRY=true

Review URL: https://codereview.chromium.org/475503005

git-svn-id: svn://svn.chromium.org/blink/trunk@180310 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 94a0c238
......@@ -99,7 +99,7 @@ class BuildersHandlerTest(unittest.TestCase):
'layout-tests': {'builders': ['WebKit Linux', 'WebKit Win']}},
'name': 'ChromiumWebkit',
'url_name': 'chromium.webkit',
'groups': ['@ToT Chromium'],
'groups': ['@ToT Chromium', '@ToT Blink'],
}],
"no_upload_test_types": buildershandler.TEST_STEPS_THAT_DO_NOT_UPLOAD_YET,
}
......
......@@ -26,6 +26,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import collections
import json
import logging
import re
......@@ -110,7 +111,7 @@ FAILURE_TO_CHAR = {
CHAR_TO_FAILURE = dict((value, key) for key, value in FAILURE_TO_CHAR.items())
def _is_directory(subtree):
return RESULTS_KEY not in subtree
return RESULTS_KEY not in subtree or not isinstance(subtree[RESULTS_KEY], collections.Sequence)
class JsonResults(object):
......
......@@ -1162,5 +1162,14 @@ class JsonResultsTest(unittest.TestCase):
tb.deactivate()
def test_normalize_results_with_top_level_results_key_does_not_crash(self):
aggregated_json = {
'Linux Tests': {
'results': {'foo': {'results': [(1, 'P')],
'times': [(1, 1)]}},
}
}
JsonResults._normalize_results(aggregated_json, 1, 2)
if __name__ == '__main__':
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment