Stop storing results files as jsonp in the test results server
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Nov 2011 01:47:13 +0000 (01:47 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Nov 2011 01:47:13 +0000 (01:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72814

Reviewed by Adam Barth.

* TestResultServer/model/jsonresults.py:
* TestResultServer/model/jsonresults_unittest.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100863 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestResultServer/model/jsonresults.py
Tools/TestResultServer/model/jsonresults_unittest.py

index 3f6e03d800fd26014c9b9a16f043996a398b6349..342bc62052ef57762a9332f194b83379ea813ef9 100644 (file)
@@ -1,3 +1,13 @@
+2011-11-19  Ojan Vafai  <ojan@chromium.org>
+
+        Stop storing results files as jsonp in the test results server
+        https://bugs.webkit.org/show_bug.cgi?id=72814
+
+        Reviewed by Adam Barth.
+
+        * TestResultServer/model/jsonresults.py:
+        * TestResultServer/model/jsonresults_unittest.py:
+
 2011-11-19  Ojan Vafai  <ojan@chromium.org>
 
         Remove the dependence on jsonp from more of new-run-webkit-tests and the test results server
index c201264507ab62a97c9fb121b8f0e9aa4dce8402..da21df747db16c0f5bb7ba28065e2970bcf45a10 100755 (executable)
@@ -60,8 +60,7 @@ class JsonResults(object):
 
     @classmethod
     def _generate_file_data(cls, json, sort_keys=False):
-        data = simplejson.dumps(json, separators=(',', ':'), sort_keys=sort_keys)
-        return JSON_RESULTS_PREFIX + data + JSON_RESULTS_SUFFIX
+        return simplejson.dumps(json, separators=(',', ':'), sort_keys=sort_keys)
 
     @classmethod
     def _load_json(cls, file_data):
index 9debeee6c6936a9d59b493940398e8d6982ba7b1..09043b3c4d793ef8ea30406fb1db4929903bb408 100755 (executable)
@@ -70,9 +70,6 @@ JSON_RESULTS_TESTS_TEMPLATE = (
     '"results":[[TESTDATA_TEST_RESULTS]],'
     '"times":[[TESTDATA_TEST_TIMES]]}')
 
-JSON_RESULTS_PREFIX = "ADD_RESULTS("
-JSON_RESULTS_SUFFIX = ");"
-
 JSON_RESULTS_TEST_LIST_TEMPLATE = (
     '{"Webkit":{"tests":{[TESTDATA_TESTS]}}}')
 
@@ -83,17 +80,17 @@ class JsonResultsTest(unittest.TestCase):
 
     def test_strip_prefix_suffix(self):
         json = "['contents']"
-        self.assertEqual(JsonResults._strip_prefix_suffix(JSON_RESULTS_PREFIX + json + JSON_RESULTS_SUFFIX), json)
+        self.assertEqual(JsonResults._strip_prefix_suffix("ADD_RESULTS(" + json + ");"), json)
         self.assertEqual(JsonResults._strip_prefix_suffix(json), json)
 
     def _make_test_json(self, test_data):
         if not test_data:
-            return JSON_RESULTS_PREFIX + JSON_RESULTS_SUFFIX
+            return ""
 
         builds = test_data["builds"]
         tests = test_data["tests"]
         if not builds or not tests:
-            return JSON_RESULTS_PREFIX + JSON_RESULTS_SUFFIX
+            return ""
 
         json = JSON_RESULTS_TEMPLATE
 
@@ -127,7 +124,7 @@ class JsonResultsTest(unittest.TestCase):
 
         json = json.replace("[TESTDATA_TESTS]", ",".join(json_tests))
 
-        return JSON_RESULTS_PREFIX + json + JSON_RESULTS_SUFFIX
+        return json
 
     def _parse_tests_dict(self, name, test):
         if "results" in test:
@@ -161,10 +158,7 @@ class JsonResultsTest(unittest.TestCase):
         for test in expected_data:
             json_tests.append("\"" + test + "\":{}")
 
-        expected_results = (JSON_RESULTS_PREFIX +
-            JSON_RESULTS_TEST_LIST_TEMPLATE.replace("[TESTDATA_TESTS]", ",".join(json_tests)) +
-            JSON_RESULTS_SUFFIX)
-
+        expected_results = JSON_RESULTS_TEST_LIST_TEMPLATE.replace("[TESTDATA_TESTS]", ",".join(json_tests))
         actual_results = JsonResults.get_test_list(self._builder, input_results)
         self.assertEquals(actual_results, expected_results)