[Patchew-devel] [PATCH 1/2] testing: Fix resetting one test

Fam Zheng posted 2 patches 6 years, 9 months ago
[Patchew-devel] [PATCH 1/2] testing: Fix resetting one test
Posted by Fam Zheng 6 years, 9 months ago
The testing-reset link was broken. All results will be cleared because
we forgot to match the test name parameter.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 mods/testing.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/mods/testing.py b/mods/testing.py
index 82b8c80..ccdd336 100644
--- a/mods/testing.py
+++ b/mods/testing.py
@@ -164,8 +164,13 @@ class TestingModule(PatchewModule):
             if k == "testing.done" or \
                k == "testing.tested-head":
                 obj.set_property(k, None)
-        for r in self.get_testing_results(obj):
-            r.delete()
+        if test:
+            r = self.get_testing_result(obj, test)
+            if r:
+                r.delete()
+        else:
+            for r in self.get_testing_results(obj):
+                r.delete()
         self.recalc_pending_tests(obj)
 
     def www_view_testing_reset(self, request, project_or_series):
-- 
2.17.1

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel