Bug 1227367 - Detect empty test suite in BaseMarionetteTestRunner; r=automatedtester
authorMaja Frydrychowicz <mjzffr@gmail.com>
Tue, 01 Mar 2016 17:37:16 -0500
changeset 347780 505196097d415f942b06e5d33b4922435773f077
parent 347779 e4ea9261d5bb84338377a1304c59bf0fd2aeb32f
child 347781 32785e40bbd2a525e1133be21b81baf828e01f2a
push id14654
push userbmo:rail@mozilla.com
push dateTue, 05 Apr 2016 19:30:33 +0000
reviewersautomatedtester
bugs1227367
milestone48.0a1
Bug 1227367 - Detect empty test suite in BaseMarionetteTestRunner; r=automatedtester If the appropriate test_handler isn't available to the runner, tests specified at the command-line silently omitted. It's possible for the runner to create an empty test-suite. This patch adds asserts to detect an empty test-suite early and provide a more specific error message. MozReview-Commit-ID: 5XL4XZHCbMu
testing/marionette/harness/marionette/runner/base.py
--- a/testing/marionette/harness/marionette/runner/base.py
+++ b/testing/marionette/harness/marionette/runner/base.py
@@ -830,16 +830,18 @@ setReq.onsuccess = function() {
 setReq.onerror = function() {
     marionetteScriptFinished(false);
 }""", script_timeout=60000)
 
         if not result:
             raise Exception("Could not launch test container app")
 
     def run_tests(self, tests):
+        assert len(tests) > 0
+        assert len(self.test_handlers) > 0
         self.reset_test_stats()
         self.start_time = time.time()
 
         need_external_ip = True
         if not self.marionette:
             self.start_marionette()
             # if we're working against a desktop version, we usually don't need
             # an external ip