openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk] branch master updated: Make travis fast again (#2308)
Date Mon, 29 May 2017 12:30:12 GMT
This is an automated email from the ASF dual-hosted git repository.

csantanapr 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  3fdbf99   Make travis fast again (#2308)
3fdbf99 is described below

commit 3fdbf99cb5ca4cc562f8afa420aa07526782872e
Author: Carlos Santana <csantana23@gmail.com>
AuthorDate: Mon May 29 08:30:09 2017 -0400

    Make travis fast again (#2308)
    
    * make travis fast again
    
    * Refactor Unicode test to be able to exclude python and swift
    
    * color term expect gradlew
    
    * do apache license header
    
    * Use abstract class
    
    * exclude Java
    
    * remove initializer from abstract class
---
 .travis.yml                                        |  4 --
 tests/build.gradle                                 |  1 +
 .../scala/system/basic/WskUnicodeJavaTests.scala   | 35 ++++++++++++++
 .../scala/system/basic/WskUnicodeNodeTests.scala   | 35 ++++++++++++++
 .../system/basic/WskUnicodePython2Tests.scala      | 35 ++++++++++++++
 .../system/basic/WskUnicodePython3Tests.scala      | 35 ++++++++++++++
 .../scala/system/basic/WskUnicodeSwiftTests.scala  | 35 ++++++++++++++
 .../test/scala/system/basic/WskUnicodeTests.scala  | 56 +++++++++++-----------
 tools/travis/build.sh                              |  6 ++-
 9 files changed, 209 insertions(+), 33 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 60fcd39..684033f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,10 +9,6 @@ scala:
 services:
   - docker
 
-env:
-  global:
-    - TERM=dumb
-
 notifications:
   email: false
   slack:
diff --git a/tests/build.gradle b/tests/build.gradle
index 718d77f..21ab9f8 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -18,6 +18,7 @@ tasks.withType(Test) {
 task testLean(type: Test) {
     exclude '**/*Swift*'
     exclude '**/*Python*'
+    exclude '**/*Java*'
     exclude '**/*ThrottleTests*'
     exclude '**/MaxActionDurationTests*'
     exclude '**/*ApiGwTests*'
diff --git a/tests/src/test/scala/system/basic/WskUnicodeJavaTests.scala b/tests/src/test/scala/system/basic/WskUnicodeJavaTests.scala
new file mode 100644
index 0000000..a8697da
--- /dev/null
+++ b/tests/src/test/scala/system/basic/WskUnicodeJavaTests.scala
@@ -0,0 +1,35 @@
+/*
+ * 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 org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
+
+import common.JsHelpers
+import common.WskTestHelpers
+
+@RunWith(classOf[JUnitRunner])
+class WskUnicodeJavaTests
+    extends WskUnicodeTests
+    with WskTestHelpers
+    with JsHelpers {
+
+    override lazy val actionKind = "java"
+    override lazy val actionSource = "unicode.jar"
+
+}
diff --git a/tests/src/test/scala/system/basic/WskUnicodeNodeTests.scala b/tests/src/test/scala/system/basic/WskUnicodeNodeTests.scala
new file mode 100644
index 0000000..e2b7289
--- /dev/null
+++ b/tests/src/test/scala/system/basic/WskUnicodeNodeTests.scala
@@ -0,0 +1,35 @@
+/*
+ * 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 org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
+
+import common.JsHelpers
+import common.WskTestHelpers
+
+@RunWith(classOf[JUnitRunner])
+class WskUnicodeNodeTests
+    extends WskUnicodeTests
+    with WskTestHelpers
+    with JsHelpers {
+
+    override lazy val actionKind = "nodejs:6"
+    override lazy val actionSource = "unicode.js"
+
+}
diff --git a/tests/src/test/scala/system/basic/WskUnicodePython2Tests.scala b/tests/src/test/scala/system/basic/WskUnicodePython2Tests.scala
new file mode 100644
index 0000000..11e9b2c
--- /dev/null
+++ b/tests/src/test/scala/system/basic/WskUnicodePython2Tests.scala
@@ -0,0 +1,35 @@
+/*
+ * 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 org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
+
+import common.JsHelpers
+import common.WskTestHelpers
+
+@RunWith(classOf[JUnitRunner])
+class WskUnicodePython2Tests
+    extends WskUnicodeTests
+    with WskTestHelpers
+    with JsHelpers {
+
+    override lazy val actionKind = "python:2"
+    override lazy val actionSource = "unicode2.py"
+
+}
diff --git a/tests/src/test/scala/system/basic/WskUnicodePython3Tests.scala b/tests/src/test/scala/system/basic/WskUnicodePython3Tests.scala
new file mode 100644
index 0000000..8f85549
--- /dev/null
+++ b/tests/src/test/scala/system/basic/WskUnicodePython3Tests.scala
@@ -0,0 +1,35 @@
+/*
+ * 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 org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
+
+import common.JsHelpers
+import common.WskTestHelpers
+
+@RunWith(classOf[JUnitRunner])
+class WskUnicodePython3Tests
+    extends WskUnicodeTests
+    with WskTestHelpers
+    with JsHelpers {
+
+    override lazy val actionKind = "python:3"
+    override lazy val actionSource = "unicode3.py"
+
+}
diff --git a/tests/src/test/scala/system/basic/WskUnicodeSwiftTests.scala b/tests/src/test/scala/system/basic/WskUnicodeSwiftTests.scala
new file mode 100644
index 0000000..93eee8d
--- /dev/null
+++ b/tests/src/test/scala/system/basic/WskUnicodeSwiftTests.scala
@@ -0,0 +1,35 @@
+/*
+ * 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 org.junit.runner.RunWith
+import org.scalatest.junit.JUnitRunner
+
+import common.JsHelpers
+import common.WskTestHelpers
+
+@RunWith(classOf[JUnitRunner])
+class WskUnicodeSwiftTests
+    extends WskUnicodeTests
+    with WskTestHelpers
+    with JsHelpers {
+
+    override lazy val actionKind = "swift:3"
+    override lazy val actionSource = "unicode.swift"
+
+}
diff --git a/tests/src/test/scala/system/basic/WskUnicodeTests.scala b/tests/src/test/scala/system/basic/WskUnicodeTests.scala
index 225a23f..485c2de 100644
--- a/tests/src/test/scala/system/basic/WskUnicodeTests.scala
+++ b/tests/src/test/scala/system/basic/WskUnicodeTests.scala
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * 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
  *
- * Licensed 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
+ *     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,
@@ -28,37 +29,38 @@ import common.WskTestHelpers
 import spray.json._
 
 @RunWith(classOf[JUnitRunner])
-class WskUnicodeTests
+abstract class WskUnicodeTests
     extends TestHelpers
     with WskTestHelpers
     with JsHelpers {
 
+    val actionKind:String
+    val actionSource:String
+
     implicit val wskprops = WskProps()
     val wsk = new Wsk
 
-    Map("nodejs:6" -> "unicode.js", "java" -> "unicode.jar", "python:2" -> "unicode2.py",
"python:3" -> "unicode3.py", "swift:3" -> "unicode.swift").foreach {
-        case (k, file) =>
-            s"$k action" should "Ensure that UTF-8 in supported in source files, input params,
logs, and output results" in withAssetCleaner(wskprops) {
-                (wp, assetHelper) =>
-                    val name = s"unicodeGalore.${k.replace(":", "")}"
 
-                    assetHelper.withCleaner(wsk.action, name) {
-                        (action, _) =>
-                            action.create(
-                                name,
-                                Some(TestUtils.getTestActionFilename(file)),
-                                main = if (k == "java") Some("Unicode") else None,
-                                kind = Some(k))
-                    }
+    s"$actionKind action" should "Ensure that UTF-8 in supported in source files, input params,
logs, and output results" in withAssetCleaner(wskprops) {
+        (wp, assetHelper) =>
+            val name = s"unicodeGalore.${actionKind.replace(":", "")}"
+
+            assetHelper.withCleaner(wsk.action, name) {
+                (action, _) =>
+                    action.create(
+                        name,
+                        Some(TestUtils.getTestActionFilename(actionSource)),
+                        main = if (actionKind == "java") Some("Unicode") else None,
+                        kind = Some(actionKind))
+            }
 
-                    withActivation(wsk.activation, wsk.action.invoke(name, parameters = Map("delimiter"
-> JsString("❄")))) {
-                        activation =>
-                            val response = activation.response
-                            response.result.get.fields.get("error") shouldBe empty
-                            response.result.get.fields.get("winter") should be(Some(JsString("❄
☃ ❄")))
+            withActivation(wsk.activation, wsk.action.invoke(name, parameters = Map("delimiter"
-> JsString("❄")))) {
+                activation =>
+                    val response = activation.response
+                    response.result.get.fields.get("error") shouldBe empty
+                    response.result.get.fields.get("winter") should be(Some(JsString("❄
☃ ❄")))
 
-                            activation.logs.toList.flatten.mkString(" ") should include("❄
☃ ❄")
-                    }
+                    activation.logs.toList.flatten.mkString(" ") should include("❄ ☃
❄")
             }
     }
 }
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index e92c2ea..4638951 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -12,6 +12,7 @@ tools/build/scanCode.py .
 cd $ROOTDIR/ansible
 
 ANSIBLE_CMD="ansible-playbook -i environments/local -e docker_image_prefix=testing"
+GRADLE_PROJS_SKIP="-x :core:pythonAction:distDocker  -x :core:python2Action:distDocker -x
:core:swift3Action:distDocker -x :core:javaAction:distDocker"
 
 $ANSIBLE_CMD setup.yml
 $ANSIBLE_CMD prereq.yml
@@ -21,7 +22,8 @@ $ANSIBLE_CMD apigateway.yml
 
 cd $ROOTDIR
 
-./gradlew distDocker -PdockerImagePrefix=testing
+TERM=dumb ./gradlew distDocker -PdockerImagePrefix=testing $GRADLE_PROJS_SKIP
+ 
 
 cd $ROOTDIR/ansible
 
@@ -30,7 +32,7 @@ $ANSIBLE_CMD openwhisk.yml
 
 cd $ROOTDIR
 cat whisk.properties
-./gradlew :tests:testLean
+TERM=dumb ./gradlew :tests:testLean $GRADLE_PROJS_SKIP
 
 cd $ROOTDIR/ansible
 $ANSIBLE_CMD logs.yml

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message