You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2016/02/24 01:03:45 UTC
ambari git commit: AMBARI-14821: Unit tests doesn't export scripts
from common-services folder into PYTHONPATH (nalex via jaoki)
Repository: ambari
Updated Branches:
refs/heads/trunk 083ac6dab -> d03205675
AMBARI-14821: Unit tests doesn't export scripts from common-services folder into PYTHONPATH (nalex via jaoki)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d0320567
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d0320567
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d0320567
Branch: refs/heads/trunk
Commit: d032056754246880a48939255784767bc31302e4
Parents: 083ac6d
Author: Jun Aoki <ja...@apache.org>
Authored: Tue Feb 23 16:03:37 2016 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Tue Feb 23 16:03:37 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/d0320567/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 6368ca1..b010804 100644
--- a/ambari-server/src/test/python/unitTests.py
+++ b/ambari-server/src/test/python/unitTests.py
@@ -108,6 +108,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)