From 5a1ff85682f5560206b734e237e77c11631154bb Mon Sep 17 00:00:00 2001 From: James Graham Date: Fri, 15 Aug 2014 14:07:49 +0100 Subject: [PATCH] Deal with deleted tests that got results when updating expected data. --- wptrunner/metadata.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/wptrunner/metadata.py b/wptrunner/metadata.py index 7c9fb3b45a1015..2f90950853057b 100644 --- a/wptrunner/metadata.py +++ b/wptrunner/metadata.py @@ -198,7 +198,11 @@ def test_id(self, id): def test_start(self, data): test_id = self.test_id(data["test"]) - test = self.expected_tree[self.id_path_map[test_id]].get_test(test_id) + try: + test = self.expected_tree[self.id_path_map[test_id]].get_test(test_id) + except KeyError: + print "Test not found %s, skipping" % test_id + return self.test_cache[test_id] = test if test_id not in self.tests_visited: @@ -208,7 +212,9 @@ def test_start(self, data): def test_status(self, data): test_id = self.test_id(data["test"]) - test = self.test_cache[test_id] + test = self.test_cache.get(test_id) + if test is None: + return test_cls = wpttest.manifest_test_cls[test.test_type] subtest = test.get_subtest(data["subtest"]) @@ -224,7 +230,9 @@ def test_status(self, data): def test_end(self, data): test_id = self.test_id(data["test"]) - test = self.test_cache[test_id] + test = self.test_cache.get(test_id) + if test is None: + return test_cls = wpttest.manifest_test_cls[test.test_type] result = test_cls.result_cls(