Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Unified Diff: Tools/TestResultServer/model/jsonresults.py

Issue 467453002: Take two at fixing android bots still using testlistjson. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/TestResultServer/model/jsonresults.py
diff --git a/Tools/TestResultServer/model/jsonresults.py b/Tools/TestResultServer/model/jsonresults.py
index 3e6d09356ee0e5ff1cb4ee2514e92bddadce1ed0..10be3fbc9665185a98d100e3f79c34d2e2e12546 100755
--- a/Tools/TestResultServer/model/jsonresults.py
+++ b/Tools/TestResultServer/model/jsonresults.py
@@ -503,3 +503,30 @@ class JsonResults(object):
if status_code != 200:
return new_results, status_code
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)
« no previous file with comments | « Tools/TestResultServer/handlers/testfilehandler_test.py ('k') | Tools/TestResultServer/model/jsonresults_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698