Skip to content

Commit 5132350

Browse files
rabbahdgrove-oss
authored andcommitted
Do not emit log marker on a re-init. (#52)
Do not emit log marker on a re-init and adjust tests for upstream changes
1 parent 41231da commit 5132350

4 files changed

Lines changed: 26 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ zip myAction.zip exec
3636

3737
Create the action using the docker image for the runtime
3838
```
39-
wsk action update myAction myAction.zip --docker openwhisk/dockerskeleton:1.3.1
39+
wsk action update myAction myAction.zip --docker openwhisk/dockerskeleton:1.3.2
4040
```
4141

4242
This works on any deployment of Apache OpenWhisk

core/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
# Apache OpenWhisk Docker Runtime Container
2121

22+
## 1.3.2
23+
Changes:
24+
- Fixes bug where a log maker is emitted more than once.
25+
2226
## 1.3.1
2327
Changes:
2428
- Disallow re-initialization by default. Added environment variable to enable re-initialization for local development.

core/actionProxy/actionproxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def init():
221221
sys.stderr.write(msg + '\n')
222222
response = flask.jsonify({'error': msg})
223223
response.status_code = 403
224-
return complete(response)
224+
return response
225225

226226
message = flask.request.get_json(force=True, silent=True)
227227
if message and not isinstance(message, dict):

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

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ import common.TestUtils
3030
import common.WskActorSystem
3131
import spray.json._
3232

33-
@RunWith(classOf[JUnitRunner])
34-
class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSystem {
35-
36-
override def withActionContainer(env: Map[String, String] = Map.empty)(code: ActionContainer => Unit) = {
37-
withContainer("dockerskeleton", env)(code)
38-
}
39-
33+
object CodeSamples {
4034
val codeNotReturningJson = """
4135
|#!/bin/sh
4236
|echo not a json object
@@ -149,6 +143,25 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
149143

150144
Seq(("bash", bash), ("python", python), ("perl", perl))
151145
}
146+
}
147+
148+
@RunWith(classOf[JUnitRunner])
149+
class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSystem {
150+
151+
override def withActionContainer(env: Map[String, String] = Map.empty)(code: ActionContainer => Unit) = {
152+
withContainer("dockerskeleton", env)(code)
153+
}
154+
155+
override val testNoSourceOrExec = TestConfig("", hasCodeStub = true)
156+
override val testNotReturningJson = TestConfig(CodeSamples.codeNotReturningJson, enforceEmptyOutputStream = false)
157+
override val testInitCannotBeCalledMoreThanOnce = TestConfig(CodeSamples.codeNotReturningJson)
158+
// the skeleton requires the executable to be called /action/exec, this test will pass with any "main"
159+
override val testEntryPointOtherThanMain =
160+
TestConfig(CodeSamples.stdLargeInputSamples(0)._2, main = "exec", false, true)
161+
override val testEcho = TestConfig(CodeSamples.stdCodeSamples(0)._2)
162+
override val testUnicode = TestConfig(CodeSamples.stdUnicodeSamples(0)._2)
163+
override val testEnv = TestConfig(CodeSamples.stdEnvSamples(0)._2)
164+
override val testLargeInput = TestConfig(CodeSamples.stdLargeInputSamples(0)._2)
152165

153166
behavior of "openwhisk/dockerskeleton"
154167

@@ -239,11 +252,4 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
239252
e shouldBe empty
240253
})
241254
}
242-
243-
testNotReturningJson(codeNotReturningJson, checkResultInLogs = true)
244-
testEcho(stdCodeSamples)
245-
testUnicode(stdUnicodeSamples)
246-
testEnv(stdEnvSamples)
247-
testLargeInput(stdLargeInputSamples)
248-
testInitCannotBeCalledMoreThanOnce(codeNotReturningJson) // any code sample will do
249255
}

0 commit comments

Comments
 (0)