You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/10/22 13:34:41 UTC

[3/9] git commit: SLIDER-553 funtests to permit launching of slider.py on unix

SLIDER-553 funtests to permit launching of slider.py on unix


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/86639d21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/86639d21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/86639d21

Branch: refs/heads/feature/SLIDER-460-stderr
Commit: 86639d21b182ee1e0b8969301454ee226b01b9f3
Parents: 46e131d
Author: Steve Loughran <st...@apache.org>
Authored: Wed Oct 22 10:31:08 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Wed Oct 22 10:31:08 2014 +0100

----------------------------------------------------------------------
 slider-assembly/src/main/scripts/slider.py             |  5 +++--
 .../slider/funtest/framework/CommandTestBase.groovy    | 13 ++++++++++---
 .../slider/funtest/framework/FuntestProperties.groovy  |  5 +++++
 .../slider/funtest/lifecycle/AgentRegistryIT.groovy    |  5 ++---
 4 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/86639d21/slider-assembly/src/main/scripts/slider.py
----------------------------------------------------------------------
diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py
index 94e40a2..c8ea0ce 100644
--- a/slider-assembly/src/main/scripts/slider.py
+++ b/slider-assembly/src/main/scripts/slider.py
@@ -51,8 +51,9 @@ to explain the code here
 """
 
 def executeEnvSh(confDir):
-  if not IS_WINDOWS:
-    envCmd = 'source %s/slider-env.sh && env' % confDir
+  envscript = '%s/slider-env.sh' % confDir
+  if not IS_WINDOWS and os.path.exists(envscript):
+    envCmd = 'source %s && env' % envscript
     command = ['bash', '-c', envCmd]
 
     proc = subprocess.Popen(command, stdout = subprocess.PIPE)

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/86639d21/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
index 58c61ea..9230a7a 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
@@ -87,8 +87,8 @@ abstract class CommandTestBase extends SliderTestUtils {
    * shell-escaped ~ symbol. On windows this does
    * not need to be escaped
    */
-  static final String TILDE
-
+  public static final String TILDE
+  
   /*
   Static initializer for test configurations. If this code throws exceptions
   (which it may) the class will not be instantiable.
@@ -113,6 +113,8 @@ abstract class CommandTestBase extends SliderTestUtils {
 
     TEST_AM_KEYTAB = SLIDER_CONFIG.getTrimmed(
         KEY_TEST_AM_KEYTAB)
+    
+    
 
     TILDE = Shell.WINDOWS? "~" : "\\~" 
   }
@@ -126,7 +128,12 @@ abstract class CommandTestBase extends SliderTestUtils {
     Configuration conf = loadSliderConf();
 
     SliderShell.confDir = SLIDER_CONF_DIRECTORY
-    SliderShell.scriptFile = SliderShell.windows ? SLIDER_SCRIPT_PYTHON : SLIDER_SCRIPT
+    
+    // choose python script if on windows or the launch key recommends it
+    // 
+    boolean python = SLIDER_CONFIG.getBoolean(KEY_LAUNCH_PYTHON, false)
+    SliderShell.scriptFile =
+        (SliderShell.windows || python) ? SLIDER_SCRIPT_PYTHON : SLIDER_SCRIPT
     
     //set the property of the configuration directory
     def path = SLIDER_CONF_DIRECTORY.absolutePath

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/86639d21/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
index 7d38ffc..92a7a95 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
@@ -74,4 +74,9 @@ public interface FuntestProperties extends SliderXMLConfKeysForTesting {
   String CORE_SITE_XML = "core-site.xml"
   String HDFS_SITE_XML = "hdfs-site.xml"
   String YARN_SITE_XML = "yarn-site.xml"
+
+  /**
+   * Flag to indicate that the .py script should be launched: {@value}
+   */
+  String KEY_LAUNCH_PYTHON = "slider.test.launch.python"
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/86639d21/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy
index 2df5f56..50da8ae 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentRegistryIT.groovy
@@ -49,7 +49,7 @@ public class AgentRegistryIT extends AgentCommandTestBase
   @Before
   public void prepareCluster() {
     setupCluster(CLUSTER)
-    describe("Create a 0-role cluster and make registry queries against it")
+
 
   }
 
@@ -60,8 +60,7 @@ public class AgentRegistryIT extends AgentCommandTestBase
 
   @Test
   public void testAgentClusterLifecycle() throws Throwable {
-
-    describe "Walk a 0-role cluster through its lifecycle"
+    describe("Create a 0-role cluster and make registry queries against it")
 
     // sanity check to verify the config is correct
     assert clusterFS.uri.scheme != "file"