<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - When testlist contains non-existing (removed) test, piglit excepts out"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=99649">99649</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>When testlist contains non-existing (removed) test, piglit excepts out
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>piglit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>minor
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>infrastructure
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>baker.dylan.c@gmail.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tomi.p.sarvela@intel.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>piglit@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This trivial patch turns exception into warning if testlist contains
non-existing tests. Issue happens easily if testlist is maintained outside
framework and subtests (or even tests) are removed.

Patch sent to mailing list, but is waiting for moderation.

Best regards,

Tomi



diff --git a/framework/profile.py b/framework/profile.py
index 94efd0a..80f1cd3 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -39,6 +39,7 @@ import multiprocessing
 import multiprocessing.dummy
 import os
 import re
+import warnings

 import six

@@ -314,7 +315,8 @@ class TestProfile(object):
         if self.forced_test_list:
             opts = collections.OrderedDict()
             for n in self.forced_test_list:
-                opts[n] = self.test_list[n]
+                try: opts[n] = self.test_list[n]
+                except KeyError: warnings.warn("Test {} missing".format(n),
RuntimeWarning)
         else:
             opts = self.test_list  # pylint: disable=redefined-variable-type</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>