Repository: ambari Updated Branches: refs/heads/branch-windows-dev 9cff20bf1 -> 051f5e160
AMBARI-8060. [Test] The framework executes the tests in random order, which makes some tests fail inconsistently (Florian Barca via alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/051f5e16 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/051f5e16 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/051f5e16 Branch: refs/heads/branch-windows-dev Commit: 051f5e1604fb0c66a062a8a62f2824e2799986f8 Parents: 9cff20b Author: Alejandro Fernandez <afernan...@hortonworks.com> Authored: Thu Nov 6 16:42:49 2014 -0800 Committer: Alejandro Fernandez <afernan...@hortonworks.com> Committed: Thu Nov 6 16:42:49 2014 -0800 ---------------------------------------------------------------------- ambari-agent/src/test/python/unitTests.py | 6 ++++-- ambari-server/src/test/python/unitTests.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/051f5e16/ambari-agent/src/test/python/unitTests.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/test/python/unitTests.py b/ambari-agent/src/test/python/unitTests.py index 082e1a1..83b6bdf 100644 --- a/ambari-agent/src/test/python/unitTests.py +++ b/ambari-agent/src/test/python/unitTests.py @@ -23,7 +23,8 @@ import doctest from os.path import dirname, split, isdir import logging.handlers import logging -from random import shuffle +#TODO Add an option to randomize the tests' execution +#from random import shuffle LOG_FILE_NAME='tests.log' SELECTED_PREFIX = "_" @@ -55,7 +56,8 @@ def all_tests_suite(): for directory in os.listdir(src_dir): if os.path.isdir(directory): files_list += os.listdir(src_dir + os.sep + directory) - shuffle(files_list) + #TODO Add an option to randomize the tests' execution + #shuffle(files_list) tests_list = [] logger.info('------------------------TESTS LIST:-------------------------------------') http://git-wip-us.apache.org/repos/asf/ambari/blob/051f5e16/ambari-server/src/test/python/unitTests.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/unitTests.py b/ambari-server/src/test/python/unitTests.py index 773a698..f1e70e1 100644 --- a/ambari-server/src/test/python/unitTests.py +++ b/ambari-server/src/test/python/unitTests.py @@ -89,7 +89,8 @@ def stack_test_executor(base_folder, stack, service, custom_tests, executor_resu tests = get_test_files(base_folder, mask = test_mask) - shuffle(tests) + #TODO Add an option to randomize the tests' execution + #shuffle(tests) modules = [os.path.basename(s)[:-3] for s in tests] suites = [unittest.defaultTestLoader.loadTestsFromName(name) for name in modules] @@ -182,7 +183,8 @@ def main(): test_mask = TEST_MASK tests = get_test_files(pwd, mask=test_mask, recursive=False) - shuffle(tests) + #TODO Add an option to randomize the tests' execution + #shuffle(tests) modules = [os.path.basename(s)[:-3] for s in tests] suites = [unittest.defaultTestLoader.loadTestsFromName(name) for name in modules]