Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openwhisk-runtime-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Groundhog
openwhisk-runtime-python
Commits
a35dab81
Commit
a35dab81
authored
8 years ago
by
dubeejw
Browse files
Options
Downloads
Patches
Plain Diff
Omit Result from Activation if Empty
- Do not display the result field from an activation record if it emptyt p
parent
12833324
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/system/basic/WskBasicTests.scala
+45
-0
45 additions, 0 deletions
tests/src/system/basic/WskBasicTests.scala
with
45 additions
and
0 deletions
tests/src/system/basic/WskBasicTests.scala
+
45
−
0
View file @
a35dab81
...
...
@@ -35,6 +35,8 @@ import common.WskTestHelpers
import
spray.json._
import
spray.json.DefaultJsonProtocol._
import
spray.json.pimpAny
import
scala.concurrent.duration.DurationInt
import
scala.language.postfixOps
@RunWith
(
classOf
[
JUnitRunner
])
class
WskBasicTests
...
...
@@ -416,6 +418,34 @@ class WskBasicTests
res
.
stdout
should
include
(
s
"ok: created action $name"
)
}
it
should
"create an action, and invoke an action that returns an empty JSON object"
in
withAssetCleaner
(
wskprops
)
{
(
wp
,
assetHelper
)
=>
val
name
=
"emptyJSONAction"
val
res
=
assetHelper
.
withCleaner
(
wsk
.
action
,
name
)
{
(
action
,
_
)
=>
action
.
create
(
name
,
Some
(
TestUtils
.
getTestActionFilename
(
"emptyJSONResult.js"
)))
action
.
invoke
(
name
,
blocking
=
true
,
result
=
true
)
}
res
.
stdout
shouldBe
(
"{}\n"
)
}
it
should
"create, and invoke an action that times out to ensure the result is empty"
in
withAssetCleaner
(
wskprops
)
{
(
wp
,
assetHelper
)
=>
val
name
=
"sleepAction"
val
params
=
Map
(
"payload"
->
"100000"
.
toJson
)
val
allowedActionDuration
=
120
seconds
val
res
=
assetHelper
.
withCleaner
(
wsk
.
action
,
name
)
{
(
action
,
_
)
=>
action
.
create
(
name
,
Some
(
TestUtils
.
getTestActionFilename
(
"timeout.js"
)),
timeout
=
Some
(
allowedActionDuration
))
action
.
invoke
(
name
,
parameters
=
params
,
blocking
=
true
,
result
=
true
)
}
res
.
stdout
shouldBe
""
}
behavior
of
"Wsk Trigger CLI"
it
should
"create, update, get, fire and list trigger"
in
withAssetCleaner
(
wskprops
)
{
...
...
@@ -534,6 +564,21 @@ class WskBasicTests
wsk
.
trigger
.
get
(
name
,
fieldFilter
=
Some
(
"invalid"
),
expectedExitCode
=
ERROR_EXIT
).
stderr
should
include
(
"error: Invalid field filter 'invalid'."
)
}
it
should
"create, and fire a trigger to ensure result is empty"
in
withAssetCleaner
(
wskprops
)
{
(
wp
,
assetHelper
)
=>
val
name
=
"emptyResultTrigger"
assetHelper
.
withCleaner
(
wsk
.
trigger
,
name
)
{
(
trigger
,
_
)
=>
trigger
.
create
(
name
)
}
val
run
=
wsk
.
trigger
.
fire
(
name
)
withActivation
(
wsk
.
activation
,
run
)
{
activation
=>
activation
.
response
.
result
shouldBe
Some
(
JsObject
())
}
}
behavior
of
"Wsk Rule CLI"
it
should
"create rule, get rule, update rule and list rule"
in
withAssetCleaner
(
wskprops
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment