2010-08-10 Victor Wang <victorw@chromium.org>
authorvictorw@chromium.org <victorw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Aug 2010 18:39:21 +0000 (18:39 +0000)
committervictorw@chromium.org <victorw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Aug 2010 18:39:21 +0000 (18:39 +0000)
        Reviewed by Ojan Vafai.

        Update test results server merge logic so the aggregated
        results and times are updated for tests that are
        in aggragated json but not in incremental json.

        Also update unittest to test this case.

        https://bugs.webkit.org/show_bug.cgi?id=43769

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

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

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

index e911169..061c35f 100644 (file)
@@ -1,3 +1,18 @@
+2010-08-10  Victor Wang  <victorw@chromium.org>
+
+        Reviewed by Ojan Vafai.
+
+        Update test results server merge logic so the aggregated
+        results and times are updated for tests that are
+        in aggragated json but not in incremental json.
+
+        Also update unittest to test this case.
+
+        https://bugs.webkit.org/show_bug.cgi?id=43769
+
+        * TestResultServer/model/jsonresults.py:
+        * TestResultServer/model/jsonresults_unittest.py:
+
 2010-08-09  Antonio Gomes  <tonikitoo@webkit.org>
 
         Reviewed by Ariya Hidayat.
index d86fbcd..f8b685e 100755 (executable)
@@ -171,8 +171,6 @@ class JsonResults(object):
 
             # Merge this build into aggreagated results.
             cls._merge_one_build(aggregated_json, incremental_json, index)
-            logging.debug("Merged build %s, merged json: %s.",
-                build_number, aggregated_json)
 
         return True
 
@@ -210,18 +208,25 @@ class JsonResults(object):
             incremental_json: incremental json object.
         """
 
-        for test_name in incremental_json:
-            incremental_test = incremental_json[test_name]
+        all_tests = (set(aggregated_json.iterkeys()) |
+                     set(incremental_json.iterkeys()))
+        for test_name in all_tests:
             if test_name in aggregated_json:
                 aggregated_test = aggregated_json[test_name]
+                if test_name in incremental_json:
+                    incremental_test = incremental_json[test_name]
+                    results = incremental_test[JSON_RESULTS_RESULTS]
+                    times = incremental_test[JSON_RESULTS_TIMES]
+                else:
+                    results = [[1, "P"]]
+                    times = [[1, "0"]]
+
                 cls._insert_item_run_length_encoded(
-                    incremental_test[JSON_RESULTS_RESULTS],
-                    aggregated_test[JSON_RESULTS_RESULTS])
+                    results, aggregated_test[JSON_RESULTS_RESULTS])
                 cls._insert_item_run_length_encoded(
-                    incremental_test[JSON_RESULTS_TIMES],
-                    aggregated_test[JSON_RESULTS_TIMES])
+                    times, aggregated_test[JSON_RESULTS_TIMES])
             else:
-                aggregated_json[test_name] = incremental_test
+                aggregated_json[test_name] = incremental_json[test_name]
 
     @classmethod
     def _insert_item_run_length_encoded(cls, incremental_item, aggregated_item):
index fd646c8..8cab017 100755 (executable)
@@ -206,11 +206,11 @@ class JsonResultsTest(unittest.TestCase):
         # Not all tests have update.
         self._test_merge(
             # Aggregated results
-            (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"], ["002.html", "[100,\"I\"]", "[100,\"1\"]"]]),
+            (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"], ["002.html", "[100,\"I\"]", "[100,\"1\"]"], ["003.html", "[10,\"F\"]", "[10,\"0\"]"]]),
             # Incremental results
             (["3"], [["002.html", "[1,\"I\"]", "[1,\"1\"]"]]),
             # Expected results
-            (["3", "2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"], ["002.html", "[101,\"I\"]", "[101,\"1\"]"]]))
+            (["3", "2", "1"], [["001.html", "[201,\"P\"]", "[201,\"0\"]"], ["002.html", "[101,\"I\"]", "[101,\"1\"]"], ["003.html", "[1,\"P\"],[10,\"F\"]", "[11,\"0\"]"]]))
 
         # Single test for multiple runs.
         self._test_merge(