[asterisk-commits] runtests.py: Add --stop-on-error (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 16 05:58:12 CDT 2017


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/6223 )

Change subject: runtests.py:  Add --stop-on-error
......................................................................

runtests.py:  Add --stop-on-error

--stop-on-error:  Stop the testsuite if a test fails.  Useful for
troubleshooting.

Change-Id: Ide7878a1611987050166b1ccd982bd618395c3ed
---
M runtests.py
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Jenkins2: Verified
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/runtests.py b/runtests.py
index b73d5af..a6a80f6 100755
--- a/runtests.py
+++ b/runtests.py
@@ -583,6 +583,7 @@
         self.start_time = time.strftime("%Y-%m-%dT%H:%M:%S %Z", time.localtime())
         test_suite_dir = os.getcwd()
         i = 0
+        global abandon_test_suite
         for t in self.tests:
             if t.can_run is False:
                 continue
@@ -666,6 +667,8 @@
             self.total_time += t.time
             if t.passed is False:
                 self.total_failures += 1
+                if self.options.stop_on_error:
+                    abandon_test_suite = True
 
     def __strip_illegal_xml_chars(self, data):
         """
@@ -781,6 +784,8 @@
     if argv is None:
         args = sys.argv
 
+    global abandon_test_suite
+
     usage = "Usage: ./runtests.py [options]"
 
     parser = optparse.OptionParser(usage=usage)
@@ -846,6 +851,9 @@
     parser.add_option("--timeout", metavar='int', type=int,
                       dest="timeout", default=-1,
                       help="Abort test after n seconds of no output.")
+    parser.add_option("--stop-on-error", action="store_true",
+                      dest="stop_on_error", default=False,
+                      help="Stops the testsuite when a test fails.")
     (options, args) = parser.parse_args(argv)
 
     # Install a signal handler for USR1/TERM, and use it to bail out of running

-- 
To view, visit https://gerrit.asterisk.org/6223
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ide7878a1611987050166b1ccd982bd618395c3ed
Gerrit-Change-Number: 6223
Gerrit-PatchSet: 3
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170816/db708c6e/attachment-0001.html>


More information about the asterisk-commits mailing list