You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/08/01 18:23:59 UTC

[GitHub] rabbah commented on a change in pull request #2520: Prints bashauto-completion install script to STDOUT

rabbah commented on a change in pull request #2520: Prints bashauto-completion install script to STDOUT
URL: https://github.com/apache/incubator-openwhisk/pull/2520#discussion_r130688152
 
 

 ##########
 File path: tests/src/test/scala/system/basic/WskSdkTests.scala
 ##########
 @@ -89,23 +89,14 @@ class WskSdkTests
         FileUtils.deleteDirectory(dir)
     }
 
-    it should "install the bash auto-completion bash script" in {
-        // Use a temp dir for testing to not disturb user's local folder
-        val dir = File.createTempFile("wskinstall", ".tmp")
-        dir.delete()
-        dir.mkdir() should be(true)
 
-        val scriptfilename = "wsk_cli_bash_completion.sh"
-        var scriptfile = new File(dir.getPath(), scriptfilename)
-        try {
-            val stdout = wsk.cli(Seq("sdk", "install", "bashauto"), workingDir = dir, expectedExitCode = SUCCESS_EXIT).stdout
-            stdout should include("is installed in the current directory")
-            val fileContent = FileUtils.readFileToString(scriptfile)
-            fileContent should include("bash completion for wsk")
-        } finally {
-            scriptfile.delete()
-            FileUtils.deleteDirectory(dir)
-        }
+    it should "install the bash auto-completion bash script using --bashrc flag" in {
+        val auth: Seq[String] = Seq("--auth", wskprops.authKey)
+        val msg = "bash completion for wsk"    // Subject to change, dependent on Cobra script
+        // Doesn't actually install, simply checking if the command is printing correctly to STDOUT
+        val stdout = wsk.cli(Seq("sdk", "install", "bashauto", "--bashrc") ++ wskprops.overrides ++ auth, expectedExitCode = SUCCESS_EXIT).stdout
+
+        stdout should include(msg)
 
 Review comment:
   Is the test going to modify the users ~/.bashrc?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services