tree: 660f247dad9e1c124a880a210858b1a33e37b570 [path history] [tgz]
  1. actions/
  2. deployment.yaml
  3. helloworld_test.go
  4. manifest.yaml
  5. README.md
tests/src/integration/helloworld/README.md

Integration Test - helloworld

Package description

The manifest.yaml file defines:

  • a Package named IntegrationTestHelloWorld which contains:

    • Four actions:

      • an action named helloNodejs
      • an action named helloJava
      • an action named helloPython
      • an action named helloSwift
    • A Sequence hello-world-series which includes all four actions.

    • A trigger triggerHelloworld to invoke hello-world-series sequence

    • A rule ruleMappingHelloworld to associate the sequence hello-world-series with trigger triggerHelloworld

  • helloNodejs:

    • accepts two parameters:
      • name (string) (default: Amy)
      • place (string) (default: Paris)
    • returns Hello Amy from Paris
  • helloJava

    • accepts one parameter:
      • name (string) (default: Bob)
    • returns Hello Bob!
  • helloPython

    • accepts one parameter:
      • name (string) (default: Henry)
    • returns Hello Henry!
  • helloSwift

    • accepts one parameter:
      • name (string) (no default)
    • returns Hello stranger!

How to deploy and test

Step 1. Deploy

Deploy it using wskdeploy:

$ wskdeploy -p tests/src/integration/helloworld

Step 2. Verify

$ wsk package get IntegrationTestHelloWorld #lists all four actions and a sequence
$ wsk trigger get triggerHelloworld
$ wsk rule get ruleMappingHelloworld

Step 3. Invoke

# invoke all four actions in a sequence hello-world-series
# results in four activation IDs and polling on displays outputs from all four actions
$ wsk trigger fire triggerHelloworld
Activation: helloSwift (5a0)
[
    "2017-09-01T17:09:51.589079299Z stdout: [\"greeting\": \"Hello stranger!\"]"
]

Activation: helloPython (219)
[
    "2017-09-01T17:09:51.554034831Z stdout: Hello Henry!"
]

Activation: helloJava (725)
[
    "2017-09-01T17:09:51.547499195Z stdout: {\"greeting\":\"Hello Bob!\"}"
]

Activation: triggerHelloworld (566)
[]

Activation: ruleMappingHelloworld (270)
[]

Activation: helloNodejs (495)
[
    "2017-09-01T17:09:51.459935244Z stdout: Hello, Amy from Paris"
]