Repository: ambari Updated Branches: refs/heads/branch-2.2 b4f067fd8 -> f80686774
AMBARI-14821: Unit tests doesn't export scripts from common-services folder into PYTHONPATH (Newton Alex via bhuvnesh2703) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f8068677 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f8068677 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f8068677 Branch: refs/heads/branch-2.2 Commit: f80686774c6c37f1832e022850859e3634eca4af Parents: b4f067fd Author: Bhuvnesh Chaudhary <[email protected]> Authored: Thu Mar 3 17:33:59 2016 -0800 Committer: Bhuvnesh Chaudhary <[email protected]> Committed: Thu Mar 3 17:33:59 2016 -0800 ---------------------------------------------------------------------- ambari-server/src/test/python/unitTests.py | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f8068677/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 b39f40c..758a564 100644 --- a/ambari-server/src/test/python/unitTests.py +++ b/ambari-server/src/test/python/unitTests.py @@ -96,6 +96,14 @@ def stack_test_executor(base_folder, service, stack, custom_tests, executor_resu if os.path.split(root)[-1] in ["scripts", "files"] and service in root: script_folders.add(root) + # Add the common-services scripts directories to the PATH + base_commserv_folder = os.path.join(server_src_dir, "main", "resources", "common-services") + for folder, subFolders, files in os.walk(os.path.join(base_commserv_folder, service)): + # folder will return the versions of the services + scripts_dir = os.path.join(folder, "package", "scripts") + if os.path.exists(scripts_dir): + script_folders.add(scripts_dir) + sys.path.extend(script_folders) tests = get_test_files(base_folder, mask = test_mask)
