underwoodb-sd-ibm commented on a change in pull request #2424: Allow optional
leading slash in CLI commands
URL:
https://github.com/apache/incubator-openwhisk/pull/2424#discussion_r132003908
##########
File path: tests/src/test/scala/system/basic/WskBasicTests.scala
##########
@@ -75,6 +75,34 @@ class WskBasicTests
stderr should include(errormsg)
}
+ it should "allow a 3 part Fully Qualified Name (FQN) without a leading
'/'" in withAssetCleaner(wskprops) {
+ (wp, assetHelper) =>
+ val guestNamespace = wsk.namespace.whois()
+ val packageName = "packageName3ptFQN"
+ val actionName = "actionName3ptFQN"
+ val triggerName = "triggerName3ptFQN"
+ val ruleName = "ruleName3ptFQN"
+ val fullQualifiedName =
s"${guestNamespace}/${packageName}/${actionName}"
+ // Used for action and rule creation below
+ assetHelper.withCleaner(wsk.pkg, packageName) {
+ (pkg, _) => pkg.create(packageName)
+ }
+ assetHelper.withCleaner(wsk.trigger, triggerName) {
+ (trigger, _) => trigger.create(triggerName)
+ }
+ // Test action and rule creation where action name is 3 part FQN
w/out leading slash
+ assetHelper.withCleaner(wsk.action, fullQualifiedName) {
+ (action, _) => action.create(fullQualifiedName, defaultAction)
+ }
+ assetHelper.withCleaner(wsk.rule, ruleName) {
+ (rule, _) =>
+ rule.create(ruleName, trigger = triggerName, action =
fullQualifiedName)
+ }
+
+ wsk.action.invoke(fullQualifiedName).stdout should include(s"ok:
invoked /$fullQualifiedName")
+ wsk.action.get(fullQualifiedName).stdout should include(s"ok: got
action ${packageName}/${actionName}")
Review comment:
I'm not sure why there is a difference in outputs between invoke and get,
but there is one. Invoke prints the FQN, while get only prints the entity name
(pkg/action). I suppose it is inconsistent - is this something that should be
brought up in a new issue? Or do you think this is something that should have
been covered in this PR?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services