openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgr...@apache.org
Subject [incubator-openwhisk-runtime-docker] branch master updated: Do not emit log marker on a re-init. (#52)
Date Mon, 09 Jul 2018 14:40:30 GMT
This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-docker.git


The following commit(s) were added to refs/heads/master by this push:
     new 5132350  Do not emit log marker on a re-init. (#52)
5132350 is described below

commit 5132350297d5220968e90a5e9b19756c5daa5742
Author: rodric rabbah <rodric@gmail.com>
AuthorDate: Mon Jul 9 10:40:28 2018 -0400

    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
---
 README.md                                          |  2 +-
 core/CHANGELOG.md                                  |  4 +++
 core/actionProxy/actionproxy.py                    |  2 +-
 .../ActionProxyContainerTests.scala                | 34 +++++++++++++---------
 4 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index 32f61cb..c01c912 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ zip myAction.zip exec
 
 Create the action using the docker image for the runtime
 ```
-wsk action update myAction myAction.zip --docker openwhisk/dockerskeleton:1.3.1
+wsk action update myAction myAction.zip --docker openwhisk/dockerskeleton:1.3.2
 ```
 
 This works on any deployment of Apache OpenWhisk
diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md
index 8712a33..fa09b5d 100644
--- a/core/CHANGELOG.md
+++ b/core/CHANGELOG.md
@@ -19,6 +19,10 @@
 
 # Apache OpenWhisk Docker Runtime Container
 
+## 1.3.2
+Changes:
+  - Fixes bug where a log maker is emitted more than once.
+
 ## 1.3.1
 Changes:
   - Disallow re-initialization by default. Added environment variable to enable re-initialization
for local development.
diff --git a/core/actionProxy/actionproxy.py b/core/actionProxy/actionproxy.py
index 0bca409..9d34776 100644
--- a/core/actionProxy/actionproxy.py
+++ b/core/actionProxy/actionproxy.py
@@ -221,7 +221,7 @@ def init():
         sys.stderr.write(msg + '\n')
         response = flask.jsonify({'error': msg})
         response.status_code = 403
-        return complete(response)
+        return response
 
     message = flask.request.get_json(force=True, silent=True)
     if message and not isinstance(message, dict):
diff --git a/tests/src/test/scala/runtime/actionContainers/ActionProxyContainerTests.scala
b/tests/src/test/scala/runtime/actionContainers/ActionProxyContainerTests.scala
index 52022ee..383f43b 100644
--- a/tests/src/test/scala/runtime/actionContainers/ActionProxyContainerTests.scala
+++ b/tests/src/test/scala/runtime/actionContainers/ActionProxyContainerTests.scala
@@ -30,13 +30,7 @@ import common.TestUtils
 import common.WskActorSystem
 import spray.json._
 
-@RunWith(classOf[JUnitRunner])
-class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSystem {
-
-  override def withActionContainer(env: Map[String, String] = Map.empty)(code: ActionContainer
=> Unit) = {
-    withContainer("dockerskeleton", env)(code)
-  }
-
+object CodeSamples {
   val codeNotReturningJson = """
                                |#!/bin/sh
                                |echo not a json object
@@ -149,6 +143,25 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
 
     Seq(("bash", bash), ("python", python), ("perl", perl))
   }
+}
+
+@RunWith(classOf[JUnitRunner])
+class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSystem {
+
+  override def withActionContainer(env: Map[String, String] = Map.empty)(code: ActionContainer
=> Unit) = {
+    withContainer("dockerskeleton", env)(code)
+  }
+
+  override val testNoSourceOrExec = TestConfig("", hasCodeStub = true)
+  override val testNotReturningJson = TestConfig(CodeSamples.codeNotReturningJson, enforceEmptyOutputStream
= false)
+  override val testInitCannotBeCalledMoreThanOnce = TestConfig(CodeSamples.codeNotReturningJson)
+  // the skeleton requires the executable to be called /action/exec, this test will pass
with any "main"
+  override val testEntryPointOtherThanMain =
+    TestConfig(CodeSamples.stdLargeInputSamples(0)._2, main = "exec", false, true)
+  override val testEcho = TestConfig(CodeSamples.stdCodeSamples(0)._2)
+  override val testUnicode = TestConfig(CodeSamples.stdUnicodeSamples(0)._2)
+  override val testEnv = TestConfig(CodeSamples.stdEnvSamples(0)._2)
+  override val testLargeInput = TestConfig(CodeSamples.stdLargeInputSamples(0)._2)
 
   behavior of "openwhisk/dockerskeleton"
 
@@ -239,11 +252,4 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
         e shouldBe empty
     })
   }
-
-  testNotReturningJson(codeNotReturningJson, checkResultInLogs = true)
-  testEcho(stdCodeSamples)
-  testUnicode(stdUnicodeSamples)
-  testEnv(stdEnvSamples)
-  testLargeInput(stdLargeInputSamples)
-  testInitCannotBeCalledMoreThanOnce(codeNotReturningJson) // any code sample will do
 }


Mime
View raw message