Commit 1aecadaa authored by ojan@chromium.org's avatar ojan@chromium.org

Get rid of testlistjson query parameter.

This is an optimization to make it so that we don't have to send
the whole results.json file down since the JSONResultsGenerator
needs this to figure out which tests it can strip. The only code
left that uses this is the Android fork of this code, which needs
to go away. So, I'm not OK with keeping this special-cased code
in the generic test results server just for that.

Deleting the code means that the requests will get the full
results.json file instead of the one with the results and times
stripped out.

TBR because this is causing 500s on the live server and that
push can't be rolled back without breaking other things.

TBR=szager@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@180005 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 97bcb597
...@@ -51,7 +51,6 @@ PARAM_BEFORE = "before" ...@@ -51,7 +51,6 @@ PARAM_BEFORE = "before"
PARAM_NUM_FILES = "numfiles" PARAM_NUM_FILES = "numfiles"
PARAM_KEY = "key" PARAM_KEY = "key"
PARAM_TEST_TYPE = "testtype" PARAM_TEST_TYPE = "testtype"
PARAM_TEST_LIST_JSON = "testlistjson"
PARAM_CALLBACK = "callback" PARAM_CALLBACK = "callback"
...@@ -155,21 +154,6 @@ class GetFile(webapp2.RequestHandler): ...@@ -155,21 +154,6 @@ class GetFile(webapp2.RequestHandler):
file.load_data() file.load_data()
return file.data, file.date return file.data, file.date
def _get_test_list_json(self, master, builder, test_type, build_number):
"""Return json file with test name list only, do not include test
results and other non-test-data .
Args:
builder: builder name.
test_type: type of test results.
"""
json, date = self._get_file_content(master, builder, test_type, build_number, "results.json")
if not json:
return None
return JsonResults.get_test_list(builder, json), date
def _serve_json(self, json, modified_date): def _serve_json(self, json, modified_date):
if json: if json:
if "If-Modified-Since" in self.request.headers: if "If-Modified-Since" in self.request.headers:
...@@ -196,7 +180,6 @@ class GetFile(webapp2.RequestHandler): ...@@ -196,7 +180,6 @@ class GetFile(webapp2.RequestHandler):
name = self.request.get(PARAM_NAME) name = self.request.get(PARAM_NAME)
before = self.request.get(PARAM_BEFORE) before = self.request.get(PARAM_BEFORE)
num_files = self.request.get(PARAM_NUM_FILES) num_files = self.request.get(PARAM_NUM_FILES)
test_list_json = self.request.get(PARAM_TEST_LIST_JSON)
callback_name = self.request.get(PARAM_CALLBACK) callback_name = self.request.get(PARAM_CALLBACK)
logging.debug( logging.debug(
...@@ -205,8 +188,6 @@ class GetFile(webapp2.RequestHandler): ...@@ -205,8 +188,6 @@ class GetFile(webapp2.RequestHandler):
if key: if key:
json, date = self._get_file_content_from_key(key) json, date = self._get_file_content_from_key(key)
elif test_list_json:
json, date = self._get_test_list_json(master, builder, test_type, build_number)
elif num_files or not master or not builder or not test_type or (not build_number and not JsonResults.is_aggregate_file(name)) or not name: elif num_files or not master or not builder or not test_type or (not build_number and not JsonResults.is_aggregate_file(name)) or not name:
limit = int(num_files) if num_files else 100 limit = int(num_files) if num_files else 100
self._get_file_list(master, builder, test_type, build_number, name, before, limit, callback_name) self._get_file_list(master, builder, test_type, build_number, name, before, limit, callback_name)
......
...@@ -503,30 +503,3 @@ class JsonResults(object): ...@@ -503,30 +503,3 @@ class JsonResults(object):
if status_code != 200: if status_code != 200:
return new_results, status_code return new_results, status_code
return TestFile.save_file(file, new_results) return TestFile.save_file(file, new_results)
@classmethod
def _delete_results_and_times(cls, tests):
for key in tests.keys():
if key in (RESULTS_KEY, TIMES_KEY):
del tests[key]
else:
cls._delete_results_and_times(tests[key])
@classmethod
def get_test_list(cls, builder, json_file_data):
logging.debug("Loading test results json...")
json = cls._load_json(json_file_data)
if not json:
return None
logging.debug("Checking test results json...")
check_json_error_string = cls._check_json(builder, json)
if check_json_error_string:
return None
test_list_json = {}
tests = json[builder][TESTS_KEY]
cls._delete_results_and_times(tests)
test_list_json[builder] = {TESTS_KEY: tests}
return cls._generate_file_data(test_list_json)
...@@ -33,7 +33,7 @@ except ImportError: ...@@ -33,7 +33,7 @@ except ImportError:
print "ERROR: Add the TestResultServer, google_appengine and yaml/lib directories to your PYTHONPATH" print "ERROR: Add the TestResultServer, google_appengine and yaml/lib directories to your PYTHONPATH"
raise raise
import master_config from handlers import master_config
import json import json
import logging import logging
...@@ -264,12 +264,6 @@ class JsonResultsTest(unittest.TestCase): ...@@ -264,12 +264,6 @@ class JsonResultsTest(unittest.TestCase):
else: else:
self.assertTrue(status_code != 200) self.assertTrue(status_code != 200)
def _test_get_test_list(self, input_data, expected_data):
input_results = self._make_test_json(input_data)
expected_results = JSON_RESULTS_TEST_LIST_TEMPLATE.replace("{[TESTDATA_TESTS]}", json.dumps(expected_data, separators=(',', ':')))
actual_results = JsonResults.get_test_list(self._builder, input_results)
self.assert_json_equal(actual_results, expected_results)
def test_update_files_empty_aggregate_data(self): def test_update_files_empty_aggregate_data(self):
small_file = MockFile(name='results-small.json') small_file = MockFile(name='results-small.json')
large_file = MockFile(name='results.json') large_file = MockFile(name='results.json')
...@@ -1026,29 +1020,6 @@ class JsonResultsTest(unittest.TestCase): ...@@ -1026,29 +1020,6 @@ class JsonResultsTest(unittest.TestCase):
"times": [[101, 0]]}}}, "times": [[101, 0]]}}},
"version": 4}) "version": 4})
# FIXME(aboxhall): Add some tests for xhtml/svg test results.
def test_get_test_name_list(self):
# Get test name list only. Don't include non-test-list data and
# of test result details.
# FIXME: This also tests a temporary bug in the data where directory-level
# results have a results and times values. Once that bug is fixed,
# remove this test-case and assert we don't ever hit it.
self._test_get_test_list(
# Input results
{"builds": ["3", "2", "1"],
"tests": {"foo": {
"001.html": {
"results": [[200, PASS]],
"times": [[200, 0]]},
"results": [[1, NO_DATA]],
"times": [[1, 0]]},
"002.html": {
"results": [[10, TEXT]],
"times": [[10, 0]]}}},
# Expected results
{"foo": {"001.html": {}}, "002.html": {}})
def test_gtest(self): def test_gtest(self):
self._test_merge( self._test_merge(
# Aggregated results # Aggregated results
......
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