Skip to content
Snippets Groups Projects
Commit 6068da27 authored by Mark Deuser's avatar Mark Deuser Committed by Justin Berstler
Browse files

Add colors for entity/JSON dumps to console (related to issue #947 and PR #949)

Remove `--full` argument from `wsk action list` and `wsk package list`
Remove `--service_guid` argument from `wsk package create|update`
Add `--summary` argument to `wsk rule get` and `wsk trigger get` commands
Add `--summary` test cases
parent 71fa0a8a
No related branches found
No related tags found
No related merge requests found
......@@ -149,9 +149,13 @@ trait ListOrGetFromCollection extends FullyQualifiedNames {
*/
def get(
name: String,
expectedExitCode: Int = SUCCESS_EXIT)(
expectedExitCode: Int = SUCCESS_EXIT,
summary: Boolean = false)(
implicit wp: WskProps): RunResult = {
cli(wp.overrides ++ Seq(noun, "get", "--auth", wp.authKey, fqn(name)), expectedExitCode)
val params = Seq(noun, "get", "--auth", wp.authKey) ++
Seq(fqn(name)) ++
{ if (summary) Seq("--summary") else Seq() }
cli(wp.overrides ++ params, expectedExitCode)
}
}
......
......@@ -334,6 +334,17 @@ class WskBasicTests
}
}
it should "display a trigger summary when --summary flag is used with 'wsk trigger get'" in withAssetCleaner(wskprops) {
(wp, assetHelper) =>
val triggerName = "mySummaryTrigger"
assetHelper.withCleaner(wsk.trigger, triggerName, confirmDelete = false) {
(trigger, name) => trigger.create(name)
}
// Summary namespace should match one of the allowable namespaces (typically 'guest')
val ns_regex_list = wsk.namespace.list().stdout.trim.replace('\n', '|')
val stdout = wsk.trigger.get(triggerName, summary = true).stdout
stdout should include regex (s"(?i)trigger\\s+/${ns_regex_list}/${triggerName}")
}
behavior of "Wsk Rule CLI"
......@@ -371,6 +382,26 @@ class WskBasicTests
wsk.rule.list().stdout should include(ruleName)
}
it should "display a rule summary when --summary flag is used with 'wsk rule get'" in withAssetCleaner(wskprops) {
(wp, assetHelper) =>
val ruleName = "mySummaryRule"
val triggerName = "summaryRuleTrigger"
val actionName = "summaryRuleAction";
assetHelper.withCleaner(wsk.trigger, triggerName) {
(trigger, name) => trigger.create(name)
}
assetHelper.withCleaner(wsk.action, actionName) {
(action, name) => action.create(name, defaultAction)
}
assetHelper.withCleaner(wsk.rule, ruleName, confirmDelete = false) {
(rule, name) => rule.create(name, trigger = triggerName, action = actionName)
}
// Summary namespace should match one of the allowable namespaces (typically 'guest')
val ns_regex_list = wsk.namespace.list().stdout.trim.replace('\n', '|')
val stdout = wsk.rule.get(ruleName, summary = true).stdout
stdout should include regex (s"(?i)rule\\s+/${ns_regex_list}/${ruleName}")
}
behavior of "Wsk Namespace CLI"
it should "list namespaces" in {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment