[Piglit] [PATCH 3/4] templates/index.mako: handle missing subtests correctly

Dylan Baker baker.dylan.c at gmail.com
Wed Sep 23 17:55:58 PDT 2015


This patch fixes the handling of subtests when more than one result is
presented. Currently this will raise a KeyError and die horribly.

cc: Ilia Mirkin <imirkin at alum.mit.edu>
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---

Ilia, this seems to have fixed the problem, can you confirm that this
does fix the problem for you appropriately?

 templates/index.mako | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/templates/index.mako b/templates/index.mako
index 6efcd41..d2b84b5 100644
--- a/templates/index.mako
+++ b/templates/index.mako
@@ -161,8 +161,9 @@
                                                    escape_filename(test)))
             else:
               raw = res.tests.get(grouptools.groupname(test))
-              if raw is not None:
-                result = raw.subtests[grouptools.testname(test)]
+              name = grouptools.testname(test)
+              if raw is not None and name in raw.subtests:
+                result = raw.subtests[name]
                 href = normalize_href(posixpath.join(escape_pathname(res.name),
                                                      escape_filename(grouptools.groupname(test))))
               else:
-- 
2.5.3



More information about the Piglit mailing list