You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/11/07 21:40:27 UTC

[GitHub] csantanapr closed pull request #4098: Split system tests

csantanapr closed pull request #4098: Split system tests
URL: https://github.com/apache/incubator-openwhisk/pull/4098
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.travis.yml b/.travis.yml
index 5f06f6cc21..20df478a04 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -73,6 +73,10 @@ jobs:
        - ./tools/travis/runSystemTests.sh
        - ./tools/travis/checkAndUploadLogs.sh system
       name: "System Tests"
+    - script:
+      - ./tools/travis/runMultiRuntimeTests.sh
+      - ./tools/travis/checkAndUploadLogs.sh multi-runtime
+      name: "Multi-Runtime Tests"
     - script:
         - ./tests/performance/preparation/deploy.sh
         - TERM=dumb ./tests/performance/wrk_tests/latency.sh "https://172.17.0.1:10001" "$(cat ansible/files/auth.guest)" 2m
diff --git a/ansible/files/runtimes-nodeonly.json b/ansible/files/runtimes-nodeonly.json
new file mode 100644
index 0000000000..f265337c58
--- /dev/null
+++ b/ansible/files/runtimes-nodeonly.json
@@ -0,0 +1,32 @@
+{
+    "runtimes": {
+        "nodejs": [
+            {
+                "kind": "nodejs:6",
+                "default": true,
+                "image": {
+                    "prefix": "openwhisk",
+                    "name": "nodejs6action",
+                    "tag": "latest"
+                },
+                "deprecated": false,
+                "attached": {
+                    "attachmentName": "codefile",
+                    "attachmentType": "text/plain"
+                },
+                "stemCells": [{
+                    "count": 2,
+                    "memory": "256 MB"
+                }]
+            }
+        ]
+
+    },
+    "blackboxes": [
+        {
+            "prefix": "openwhisk",
+            "name": "dockerskeleton",
+            "tag": "latest"
+        }
+    ]
+}
diff --git a/ansible/group_vars/all b/ansible/group_vars/all
index 7dfb293d25..86c231ad04 100755
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@@ -48,7 +48,9 @@ whisk:
 #   runtimes_bypass_pull_for_local_images: optional, if true, allow images with a prefix that matches
 #       {{ runtimes_local_image_prefix }} to skip docker pull in invoker even if the image is not part of the blackbox set
 #
-runtimesManifest: "{{ runtimes_manifest | default(lookup('file', openwhisk_home ~ '/ansible/files/runtimes.json') | from_json) }}"
+
+manifestfile: "{{ manifest_file | default('/ansible/files/runtimes.json') }}"
+runtimesManifest: "{{ runtimes_manifest | default(lookup('file', openwhisk_home ~ '{{ manifestfile }}') | from_json) }}"
 
 limits:
   invocationsPerMinute: "{{ limit_invocations_per_minute | default(60) }}"
diff --git a/tests/build.gradle b/tests/build.gradle
index 4be83cad58..ca3050472c 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -69,7 +69,6 @@ ext.testSets = [
         "includes" : [
             "apigw/healthtests/**",
             "ha/**",
-            "limits/**",
             "services/**",
             "system/basic/**",
             "system/rest/**",
@@ -79,6 +78,16 @@ ext.testSets = [
             "whisk/core/limits/**",
             "whisk/core/database/test/*CacheConcurrencyTests*",
             "whisk/core/controller/test/*ControllerApiTests*",
+        ],
+        "excludes": [
+            "system/basic/WskMultiRuntimeTests*"
+        ]
+    ],
+    "REQUIRE_MULTI_RUNTIME" : [
+        "includes" : [
+            "system/basic/*MultiRuntimeTests*",
+            "system/basic/*UnicodeTests*",
+            "limits/**"
         ]
     ],
     "LEAN" : [
diff --git a/tests/src/test/scala/system/basic/WskActionTests.scala b/tests/src/test/scala/system/basic/WskActionTests.scala
index bec66b7964..693ebb9b96 100644
--- a/tests/src/test/scala/system/basic/WskActionTests.scala
+++ b/tests/src/test/scala/system/basic/WskActionTests.scala
@@ -231,26 +231,6 @@ class WskActionTests extends TestHelpers with WskTestHelpers with JsHelpers with
     }
   }
 
-  it should "update an action with different language and check preserving params" in withAssetCleaner(wskprops) {
-    (wp, assetHelper) =>
-      val name = "updatedAction"
-
-      assetHelper.withCleaner(wsk.action, name, false) { (action, _) =>
-        wsk.action.create(
-          name,
-          Some(TestUtils.getTestActionFilename("hello.js")),
-          parameters = Map("name" -> testString.toJson)) //unused in the first function
-      }
-
-      wsk.action.create(name, Some(TestUtils.getTestActionFilename("hello.py")), update = true)
-
-      val run = wsk.action.invoke(name)
-      withActivation(wsk.activation, run) { activation =>
-        activation.response.status shouldBe "success"
-        activation.logs.get.mkString(" ") should include(s"Hello $testString")
-      }
-  }
-
   it should "fail to invoke an action with an empty file" in withAssetCleaner(wskprops) { (wp, assetHelper) =>
     val name = "empty"
     assetHelper.withCleaner(wsk.action, name) { (action, _) =>
diff --git a/tests/src/test/scala/system/basic/WskMultiRuntimeTests.scala b/tests/src/test/scala/system/basic/WskMultiRuntimeTests.scala
new file mode 100644
index 0000000000..2301f65d08
--- /dev/null
+++ b/tests/src/test/scala/system/basic/WskMultiRuntimeTests.scala
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package system.basic
+import common.JsHelpers
+import common.TestHelpers
+import common.TestUtils
+import common.WskActorSystem
+import common.WskOperations
+import common.WskProps
+import common.WskTestHelpers
+import common.rest.WskRestOperations
+import org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
+import spray.json._
+import spray.json.DefaultJsonProtocol._
+
+@RunWith(classOf[JUnitRunner])
+class WskMultiRuntimeTests extends TestHelpers with WskTestHelpers with JsHelpers with WskActorSystem {
+
+  implicit val wskprops = WskProps()
+  // wsk must have type WskOperations so that tests using CLI (class Wsk)
+  // instead of REST (WskRestOperations) still work.
+  val wsk: WskOperations = new WskRestOperations
+  val testString = "this is a test"
+
+  it should "update an action with different language and check preserving params" in withAssetCleaner(wskprops) {
+    (wp, assetHelper) =>
+      val name = "updatedAction"
+
+      assetHelper.withCleaner(wsk.action, name, false) { (action, _) =>
+        wsk.action.create(
+          name,
+          Some(TestUtils.getTestActionFilename("hello.js")),
+          parameters = Map("name" -> testString.toJson)) //unused in the first function
+      }
+
+      wsk.action.create(name, Some(TestUtils.getTestActionFilename("hello.py")), update = true)
+
+      val run = wsk.action.invoke(name)
+      withActivation(wsk.activation, run) { activation =>
+        activation.response.status shouldBe "success"
+        activation.logs.get.mkString(" ") should include(s"Hello $testString")
+      }
+  }
+}
diff --git a/tools/travis/runMultiRuntimeTests.sh b/tools/travis/runMultiRuntimeTests.sh
new file mode 100755
index 0000000000..e2de0c59bd
--- /dev/null
+++ b/tools/travis/runMultiRuntimeTests.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -e
+
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+
+cd $ROOTDIR/tools/travis
+
+export ORG_GRADLE_PROJECT_testSetName="REQUIRE_MULTI_RUNTIME"
+export GRADLE_COVERAGE=true
+
+./setupPrereq.sh
+
+./distDocker.sh
+
+./setupSystem.sh
+
+./runTests.sh
diff --git a/tools/travis/runSystemTests.sh b/tools/travis/runSystemTests.sh
index f9c9ad3279..8325caddba 100755
--- a/tools/travis/runSystemTests.sh
+++ b/tools/travis/runSystemTests.sh
@@ -27,10 +27,10 @@ cd $ROOTDIR/tools/travis
 export ORG_GRADLE_PROJECT_testSetName="REQUIRE_SYSTEM"
 export GRADLE_COVERAGE=true
 
-./setupPrereq.sh
+./setupPrereq.sh /ansible/files/runtimes-nodeonly.json
 
 ./distDocker.sh
 
-./setupSystem.sh
+./setupSystem.sh /ansible/files/runtimes-nodeonly.json
 
 ./runTests.sh
diff --git a/tools/travis/setupPrereq.sh b/tools/travis/setupPrereq.sh
index e53daec834..f820c28323 100755
--- a/tools/travis/setupPrereq.sh
+++ b/tools/travis/setupPrereq.sh
@@ -22,6 +22,7 @@ set -e
 SECONDS=0
 SCRIPTDIR=$(cd $(dirname "$0") && pwd)
 ROOTDIR="$SCRIPTDIR/../.."
+RUNTIMES_MANIFEST=${1:-"/ansible/files/runtimes.json"}
 
 cd $ROOTDIR/ansible
 
@@ -31,5 +32,5 @@ $ANSIBLE_CMD couchdb.yml
 $ANSIBLE_CMD initdb.yml
 $ANSIBLE_CMD wipe.yml
 
-$ANSIBLE_CMD properties.yml
+$ANSIBLE_CMD properties.yml -e manifest_file="$RUNTIMES_MANIFEST"
 echo "Time taken for ${0##*/} is $SECONDS secs"
diff --git a/tools/travis/setupSystem.sh b/tools/travis/setupSystem.sh
index 55c78ecb35..0750dddcf1 100755
--- a/tools/travis/setupSystem.sh
+++ b/tools/travis/setupSystem.sh
@@ -22,10 +22,11 @@ set -e
 SECONDS=0
 SCRIPTDIR=$(cd $(dirname "$0") && pwd)
 ROOTDIR="$SCRIPTDIR/../.."
+RUNTIMES_MANIFEST=${1:-"/ansible/files/runtimes.json"}
 
 cd $ROOTDIR/ansible
 
-$ANSIBLE_CMD openwhisk.yml
+$ANSIBLE_CMD openwhisk.yml -e manifest_file="$RUNTIMES_MANIFEST"
 $ANSIBLE_CMD apigateway.yml
 $ANSIBLE_CMD routemgmt.yml
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services