This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new c5d5d46  Make --web flag test more durable. (#3285)
c5d5d46 is described below

commit c5d5d46e0c382ad8a86f44797e91b4bbaa290640
Author: Markus Thömmes <markusthoem...@me.com>
AuthorDate: Wed Feb 14 22:21:10 2018 +0100

    Make --web flag test more durable. (#3285)
    
    Relying on updates will intermittently fail if you have multiple controller 
because they perform distributed cache invalidation. That test doesn't need to 
be relying on that so just creating a new action for each fixes that 
intermittent failure.
    
    Furthermore, the order of annotations seems non-deterministic.
---
 .../scala/whisk/core/cli/test/WskBasicUsageTests.scala     | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala 
b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
index a2ed634..970d569 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
@@ -428,21 +428,17 @@ class WskBasicUsageTests extends TestHelpers with 
WskTestHelpers {
   }
 
   it should "ensure --web flags set the proper annotations" in 
withAssetCleaner(wskprops) { (wp, assetHelper) =>
-    val name = "webaction"
-    val file = Some(TestUtils.getTestActionFilename("echo.js"))
-
-    assetHelper.withCleaner(wsk.action, name) { (action, _) =>
-      action.create(name, file)
-    }
-
     Seq("true", "faLse", "tRue", "nO", "yEs", "no", "raw", "NO", 
"Raw").foreach { flag =>
       val webEnabled = flag.toLowerCase == "true" || flag.toLowerCase == "yes"
       val rawEnabled = flag.toLowerCase == "raw"
 
-      wsk.action.create(name, file, web = Some(flag.toLowerCase), update = 
true)
+      val name = "webaction-" + flag
+      assetHelper.withCleaner(wsk.action, name) { (action, _) =>
+        action.create(name, Some(TestUtils.getTestActionFilename("echo.js")), 
web = Some(flag.toLowerCase))
+      }
 
       val action = wsk.action.get(name)
-      action.getFieldJsValue("annotations") shouldBe JsArray(
+      action.getFieldJsValue("annotations").convertTo[Set[JsObject]] shouldBe 
Set(
         JsObject("key" -> JsString("exec"), "value" -> JsString("nodejs:6")),
         JsObject("key" -> JsString("web-export"), "value" -> 
JsBoolean(webEnabled || rawEnabled)),
         JsObject("key" -> JsString("raw-http"), "value" -> 
JsBoolean(rawEnabled)),

-- 
To stop receiving notification emails like this one, please contact
dube...@apache.org.

Reply via email to