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/09/06 18:26:01 UTC

[GitHub] dubeejw commented on a change in pull request #2544: Allow CLI to Save Code from Action (Review)

dubeejw commented on a change in pull request #2544: Allow CLI to Save Code from Action (Review)
URL: https://github.com/apache/incubator-openwhisk/pull/2544#discussion_r137351436
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
 ##########
 @@ -826,6 +828,72 @@ class WskBasicUsageTests
                 s"(?i)action /${namespace}/${actNameNoDescOrParams}\\s*\\(parameters: none defined\\)")
     }
 
+    it should "save action code to file" in withAssetCleaner(wskprops) {
+        (wp, assetHelper) =>
+            val name = "saveAction"
+            val seqName = "seqName"
+            val dockerName = "dockerName"
+            val containerName = s"bogus${Random.alphanumeric.take(16).mkString.toLowerCase}"
+            val saveName = s"save-as-$name.js"
+            val currentDir = System.getProperty("user.dir")
+            val saveDir = if (currentDir.endsWith("tests")) {
+                currentDir
+            } else {
+                s"$currentDir${File.separator}tests"
+            }
+            val badSaveName = s"bad-directory${File.separator}$saveName"
+
+            assetHelper.withCleaner(wsk.action, name) {
+                (action, _) =>
+                    action.create(name, defaultAction)
+            }
+
+            wsk.action.get(name, save = Some(true)).stdout should include(s"saved action code to $name.js")
 
 Review comment:
   Unfortunately Cobra will not allow two different data types for the same flag.
 
----------------------------------------------------------------
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