Skip to content

Commit 2cd77e4

Browse files
authored
Update for action version. (#79)
See apache/openwhisk#4761.
1 parent b46be6f commit 2cd77e4

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

tests/src/test/scala/runtime/actionContainers/ActionProxyContainerTests.scala

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,23 @@ object CodeSamples {
8585

8686
/** Standard code samples, should print 'hello' to stdout and echo the input args. */
8787
val stdEnvSamples = {
88-
val bash = """
89-
|#!/bin/bash
90-
|echo "{ \
91-
|\"api_host\": \"$__OW_API_HOST\", \"api_key\": \"$__OW_API_KEY\", \
92-
|\"namespace\": \"$__OW_NAMESPACE\", \"action_name\": \"$__OW_ACTION_NAME\", \
93-
|\"activation_id\": \"$__OW_ACTIVATION_ID\", \"deadline\": \"$__OW_DEADLINE\" }"
94-
""".stripMargin.trim
88+
val bash =
89+
"""
90+
|#!/bin/bash
91+
|echo "{ \
92+
|\"api_host\": \"$__OW_API_HOST\", \"api_key\": \"$__OW_API_KEY\", \
93+
|\"namespace\": \"$__OW_NAMESPACE\", \"action_name\": \"$__OW_ACTION_NAME\", \"action_version\": \"$__OW_ACTION_VERSION\", \
94+
|\"activation_id\": \"$__OW_ACTIVATION_ID\", \"deadline\": \"$__OW_DEADLINE\" }"
95+
""".stripMargin.trim
9596

9697
val python =
9798
"""
9899
|#!/usr/bin/env python
99100
|import os
100101
|
101-
|print('{ "api_host": "%s", "api_key": "%s", "namespace": "%s", "action_name" : "%s", "activation_id": "%s", "deadline": "%s" }' % (
102+
|print('{ "api_host": "%s", "api_key": "%s", "namespace": "%s", "action_name" : "%s", action_version" : "%s", "activation_id": "%s", "deadline": "%s" }' % (
102103
| os.environ['__OW_API_HOST'], os.environ['__OW_API_KEY'],
103-
| os.environ['__OW_NAMESPACE'], os.environ['__OW_ACTION_NAME'],
104+
| os.environ['__OW_NAMESPACE'], os.environ['__OW_ACTION_NAME'], os.environ['__OW_ACTION_VERSION'],
104105
| os.environ['__OW_ACTIVATION_ID'], os.environ['__OW_DEADLINE']))
105106
""".stripMargin.trim
106107

@@ -111,9 +112,10 @@ object CodeSamples {
111112
|$b = $ENV{'__OW_API_KEY'};
112113
|$c = $ENV{'__OW_NAMESPACE'};
113114
|$d = $ENV{'__OW_ACTION_NAME'};
115+
|$r = $ENV{'__OW_ACTION_VERSION'};
114116
|$e = $ENV{'__OW_ACTIVATION_ID'};
115117
|$f = $ENV{'__OW_DEADLINE'};
116-
|print "{ \"api_host\": \"$a\", \"api_key\": \"$b\", \"namespace\": \"$c\", \"action_name\": \"$d\", \"activation_id\": \"$e\", \"deadline\": \"$f\" }";
118+
|print "{ \"api_host\": \"$a\", \"api_key\": \"$b\", \"namespace\": \"$c\", \"action_name\": \"$d\", \"action_version\": \"$r\", \"activation_id\": \"$e\", \"deadline\": \"$f\" }";
117119
""".stripMargin.trim
118120

119121
Seq(("bash", bash), ("python", python), ("perl", perl))

0 commit comments

Comments
 (0)