[Asterisk-code-review] runtests.py: Add parameter --randomorder. (testsuite[master])
Corey Farrell
asteriskteam at digium.com
Fri May 29 17:31:29 CDT 2015
Corey Farrell has uploaded a new change for review.
https://gerrit.asterisk.org/550
Change subject: runtests.py: Add parameter --randomorder.
......................................................................
runtests.py: Add parameter --randomorder.
This adds a parameter to runtests.py that allows the tests to be run
in a randomized order instead of alphabetically. This can be useful
when testing a change to the Asterisk that requires running the full
testsuite. For example if the change breaks rest_api, you will not
have to wait for 80% of the testsuite to run before those tests start
to produce failures.
Change-Id: I002c6fa2c7a05e44673cb56b11d4e4c381f3eba0
---
M runtests.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/50/550/1
diff --git a/runtests.py b/runtests.py
index 971de7c..00288b8 100755
--- a/runtests.py
+++ b/runtests.py
@@ -336,6 +336,8 @@
self.global_config = self._parse_global_config()
self.tests = sorted(self._parse_test_yaml("tests", ast_version),
key=lambda test: test.test_name)
+ if self.options.randomorder:
+ random.shuffle(self.tests)
self.total_time = 0.0
self.total_count = 0
self.total_failures = 0
@@ -602,6 +604,9 @@
parser.add_option("-c", "--cleanup", action="store_true",
dest="cleanup", default=False,
help="Cleanup tmp directory after each successful test")
+ parser.add_option("--random-order", action="store_true",
+ dest="randomorder", default=False,
+ help="Shuffle the tests so they are run in random order")
(options, args) = parser.parse_args(argv)
ast_version = AsteriskVersion(options.version)
--
To view, visit https://gerrit.asterisk.org/550
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I002c6fa2c7a05e44673cb56b11d4e4c381f3eba0
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
More information about the asterisk-code-review
mailing list