You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2018/05/14 18:48:32 UTC

[incubator-openwhisk] branch master updated: Split test jobs in Travis (#3613)

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 fb5f853  Split test jobs in Travis (#3613)
fb5f853 is described below

commit fb5f85303193ca917ce02e0905d2eb7516f4f3a5
Author: Chetan Mehrotra <ch...@apache.org>
AuthorDate: Mon May 14 11:48:27 2018 -0700

    Split test jobs in Travis (#3613)
---
 .travis.yml                                        | 12 +--
 ansible/logs.yml                                   |  1 +
 .../core/database/memory/MemoryArtifactStore.scala | 13 +++
 tests/README.md                                    | 36 +++++++++
 tests/build.gradle                                 | 92 +++++++++++++++++++++-
 tools/build/checkLogs.py                           | 23 +++---
 tools/build/redo                                   |  8 +-
 tools/travis/README.md                             | 36 +++++++++
 tools/travis/checkAndUploadLogs.sh                 | 41 ++++++++++
 tools/travis/distDocker.sh                         | 30 +++++++
 tools/travis/runSystemTests.sh                     | 35 ++++++++
 tools/travis/runTests.sh                           | 32 ++++++++
 tools/travis/runUnitTests.sh                       | 35 ++++++++
 tools/travis/scan.sh                               | 52 ++++++++++++
 tools/travis/setupPrereq.sh                        | 35 ++++++++
 tools/travis/setupSystem.sh                        | 31 ++++++++
 16 files changed, 493 insertions(+), 19 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 395d04e..e37432e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -48,7 +48,6 @@ notifications:
 before_install:
   - pip install --upgrade pip setuptools six
   - pip3 install --upgrade pip setuptools six
-  - ./tools/travis/flake8.sh  # Check Python files for style and stop the build on syntax errors
 
 install:
   - ./tools/travis/setup.sh
@@ -56,10 +55,13 @@ install:
 jobs:
   include:
     - script:
-        - ./tools/travis/build.sh
-        - ansible-playbook -i ansible/environments/local ansible/logs.yml # collect logs regardless of build exit
-        - ./tools/travis/box-upload.py "$TRAVIS_BUILD_DIR/logs" "$TRAVIS_BUILD_ID-$TRAVIS_BRANCH.tar.gz"
-      env: DESCRIPTION="Execute test suite."
+        - ./tools/travis/runUnitTests.sh
+        - ./tools/travis/checkAndUploadLogs.sh unit db
+      env: DESCRIPTION="Unit Tests"
+    - script:
+       - ./tools/travis/runSystemTests.sh
+       - ./tools/travis/checkAndUploadLogs.sh system
+      env: DESCRIPTION="System Tests"
     - script:
         - ./performance/preparation/deploy.sh
         - TERM=dumb ./performance/wrk_tests/latency.sh "https://172.17.0.1:10001" "$(cat ansible/files/auth.guest)" 2m
diff --git a/ansible/logs.yml b/ansible/logs.yml
index 3182199..30c7bd3 100644
--- a/ansible/logs.yml
+++ b/ansible/logs.yml
@@ -72,3 +72,4 @@
   - name: fetch logs from all machines
     synchronize: src="{{ whisk_logs_dir }}/" dest="{{ openwhisk_home }}/logs" mode=pull
     when: "'machine' not in exclude_logs_from"
+    ignore_errors: true
diff --git a/common/scala/src/main/scala/whisk/core/database/memory/MemoryArtifactStore.scala b/common/scala/src/main/scala/whisk/core/database/memory/MemoryArtifactStore.scala
index 0b96d06..e228652 100644
--- a/common/scala/src/main/scala/whisk/core/database/memory/MemoryArtifactStore.scala
+++ b/common/scala/src/main/scala/whisk/core/database/memory/MemoryArtifactStore.scala
@@ -240,10 +240,16 @@ class MemoryArtifactStore[DocumentAbstraction <: DocumentSerializer](dbName: Str
   override protected[core] def readAttachment[T](doc: DocInfo, name: String, sink: Sink[ByteString, Future[T]])(
     implicit transid: TransactionId): Future[(ContentType, T)] = {
     //TODO Temporary implementation till MemoryAttachmentStore PR is merged
+    val start = transid.started(
+      this,
+      LoggingMarkers.DATABASE_ATT_GET,
+      s"[ATT_GET] '$dbName' finding attachment '$name' of document '$doc'")
+
     artifacts.get(doc.id.id) match {
       case Some(a: Artifact) if a.attachments.contains(name) =>
         val attachment = a.attachments(name)
         val r = Source.single(attachment.bytes).toMat(sink)(Keep.right).run
+        transid.finished(this, start, s"[ATT_GET] '$dbName' completed: found attachment '$name' of document '$doc'")
         r.map(t => (attachment.contentType, t))
       case None =>
         Future.failed(NoDocumentException("Not found on 'readAttachment'."))
@@ -260,6 +266,11 @@ class MemoryArtifactStore[DocumentAbstraction <: DocumentSerializer](dbName: Str
     contentType: ContentType,
     docStream: Source[ByteString, _])(implicit transid: TransactionId): Future[DocInfo] = {
 
+    val start = transid.started(
+      this,
+      LoggingMarkers.DATABASE_ATT_SAVE,
+      s"[ATT_PUT] '$dbName' uploading attachment '$name' of document '$doc'")
+
     //TODO Temporary implementation till MemoryAttachmentStore PR is merged
     val f = docStream.runFold(new ByteStringBuilder)((builder, b) => builder ++= b)
     val g = f
@@ -269,6 +280,8 @@ class MemoryArtifactStore[DocumentAbstraction <: DocumentSerializer](dbName: Str
             val existing = Artifact(doc, a.doc, a.computed)
             val updated = existing.attach(name, Attachment(b.result().compact, contentType))
             if (artifacts.replace(doc.id.id, existing, updated)) {
+              transid
+                .finished(this, start, s"[ATT_PUT] '$dbName' completed uploading attachment '$name' of document '$doc'")
               updated.docInfo
             } else {
               throw DocumentConflictException("conflict on 'put'")
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 0000000..e2c37eb
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,36 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Running Tests
+
+This module hosts all the unit and integration test for this repo. Command examples given below are meant to be executed
+from project root.
+
+To run all tests
+
+    $ ./gradlew tests:test
+
+This requires the OpenWhisk system to be setup and running locally.
+
+## Running Unit Tests
+
+To just run the unit tests
+
+    $ ansible-playbook -i ansible/environments/local ansible/properties.yml
+    $ ./gradlew tests:testUnit
diff --git a/tests/build.gradle b/tests/build.gradle
index e50751b..c1c4356 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -1,4 +1,5 @@
 import org.scoverage.ScoverageReport
+import static groovy.json.JsonOutput.*
 
 apply plugin: 'scala'
 apply plugin: 'eclipse'
@@ -29,12 +30,91 @@ def leanExcludes = [
     '**/*Java*',
     '**/*ThrottleTests*',
     '**/MaxActionDurationTests*',
-    '**/*ApiGwRestBasicTests*',
-    '**/*WskCli*'
 ]
 
+ext.testSets = [
+    "REQUIRE_ONLY_DB" : [
+        "includes" : [
+            "actionContainers/**",
+            "ha/**",
+            "whisk/**"
+        ],
+        "excludes" : [
+            "whisk/core/admin/**",
+            "whisk/core/apigw/actions/test/**",
+            "whisk/core/cli/test/**",
+            "whisk/core/limits/**",
+            "**/*CacheConcurrencyTests*",
+            "**/*ControllerApiTests*",
+        ]
+    ],
+    "REQUIRE_SYSTEM" : [
+        "includes" : [
+            "apigw/healthtests/**",
+            "services/**",
+            "system/basic/**",
+            "system/rest/**",
+            "whisk/core/admin/**",
+            "whisk/core/cli/test/**",
+            "whisk/core/apigw/actions/test/**",
+            "whisk/core/limits/**",
+            "whisk/core/database/test/*CacheConcurrencyTests*",
+            "whisk/core/controller/test/*ControllerApiTests*",
+        ]
+    ],
+    "LEAN" : [
+        "excludes" : leanExcludes
+    ]
+]
+
+testSets.each {setName, patterns ->
+    def excludes = patterns["excludes"] ?: new HashSet<>()
+    excludes.addAll(leanExcludes)
+    patterns["excludes"] = excludes
+}
+
+//The value can be specified either via env variable
+// ORG_GRADLE_PROJECT_testSetName
+//Or via property -PtestSetName
+if (!project.hasProperty("testSetName")) {
+    ext.testSetName = "LEAN"
+}
+
+def getPattern(String name, String type) {
+    def patterns = testSets[name]
+    assert patterns : "No pattern found for $name"
+    return patterns[type] ?: []
+}
+
+def logTestSetInfo(){
+    println "Using testSet $testSetName - ${prettyPrint(toJson(testSets[testSetName]))}"
+}
+
 task testLean(type: Test) {
-    exclude leanExcludes
+    doFirst {
+        logTestSetInfo()
+    }
+    exclude getPattern(testSetName, "excludes")
+    include getPattern(testSetName, "includes")
+}
+
+task testUnit(type: Test) {
+    systemProperty("whisk.spi.ArtifactStoreProvider", "whisk.core.database.memory.MemoryArtifactStoreProvider")
+    exclude getPattern("REQUIRE_ONLY_DB", "excludes")
+    include getPattern("REQUIRE_ONLY_DB", "includes")
+
+    //Test below have direct dependency on CouchDB running
+    def couchDbExcludes = [
+        "**/*NamespaceBlacklistTests*",
+        "**/*CleanUpActivationsTest*",
+        "**/*CouchDbRestClientTests*",
+        "**/*RemoveLogsTests*",
+        "**/*ReplicatorTest*",
+        "**/*CouchDBArtifactStoreTests*",
+    ]
+
+    exclude couchDbExcludes
+    exclude "actionContainers/**"
 }
 
 task testLeanCli(type: Test) {
@@ -102,8 +182,12 @@ task createKeystore(dependsOn: deleteKeystore) {
 
 afterEvaluate {
     task testCoverageLean(type:Test) {
+        doFirst {
+            logTestSetInfo()
+        }
         classpath = getScoverageClasspath(project)
-        exclude leanExcludes
+        exclude getPattern(testSetName, "excludes")
+        include getPattern(testSetName, "includes")
     }
 
     task testCoverage(type:Test) {
diff --git a/tools/build/checkLogs.py b/tools/build/checkLogs.py
index cf315b7..b436042 100755
--- a/tools/build/checkLogs.py
+++ b/tools/build/checkLogs.py
@@ -76,32 +76,37 @@ def colors():
 
 # Script entrypoint.
 if __name__ == "__main__":
-    if len(sys.argv) != 2:
+    if len(sys.argv) > 3:
         sys.stderr.write("Usage: %s logs_directory.\n" % sys.argv[0])
         sys.exit(1)
 
     root_dir = sys.argv[1]
 
+    tags_to_check = []
+    if len(sys.argv) == 3:
+        tags_to_check = {x.strip() for x in sys.argv[2].split(',')}
+
     col = colors()
 
     if not os.path.isdir(root_dir):
         sys.stderr.write("%s: %s is not a directory.\n" % (sys.argv[0], root_dir))
 
     file_checks = [
-        ("db-rules.log", [ partial(database_has_at_most_x_entries, 0) ]),
-        ("db-triggers.log", [ partial(database_has_at_most_x_entries, 0) ]),
+        ("db-rules.log", {"db"}, [ partial(database_has_at_most_x_entries, 0) ]),
+        ("db-triggers.log", {"db"}, [ partial(database_has_at_most_x_entries, 0) ]),
         # Assert that stdout of the container is correctly piped and empty
-        ("controller0.log", [ partial(file_has_at_most_x_bytes, 0) ]),
-        ("invoker0.log", [ partial(file_has_at_most_x_bytes, 0) ])
+        ("controller0.log", {"system"}, [ partial(file_has_at_most_x_bytes, 0) ]),
+        ("invoker0.log", {"system"}, [ partial(file_has_at_most_x_bytes, 0) ])
     ]
 
     all_errors = []
 
     # Runs all relevant checks on all relevant files.
-    for file_name, checks in file_checks:
-        file_path = root_dir + "/" + file_name
-        errors = run_file_checks(file_path, checks)
-        all_errors += map(lambda p: (file_path, p[0], p[1]), errors)
+    for file_name, tags, checks in file_checks:
+        if not tags_to_check or any(t in tags for t in tags_to_check):
+            file_path = root_dir + "/" + file_name
+            errors = run_file_checks(file_path, checks)
+            all_errors += map(lambda p: (file_path, p[0], p[1]), errors)
 
     sort_key = lambda p: p[0]
 
diff --git a/tools/build/redo b/tools/build/redo
index 6dc3cd8..de0d300 100755
--- a/tools/build/redo
+++ b/tools/build/redo
@@ -324,7 +324,13 @@ Components = [
                   'run all tests',
                   yaml = False,
                   gradle = True,
-                  tasks = 'test')
+                  tasks = 'test'),
+
+    makeComponent('unit-tests',
+                  'run units tests',
+                  yaml = False,
+                  tasks = 'testUnit',
+                  gradle = 'tests')
 ]
 
 def getComponent(component):
diff --git a/tools/travis/README.md b/tools/travis/README.md
new file mode 100644
index 0000000..fd5e554
--- /dev/null
+++ b/tools/travis/README.md
@@ -0,0 +1,36 @@
+<!--
+#
+# 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.
+#
+-->
+
+# Travis Setup
+
+Travis build is configured to perform build of this repo in multiple parallel jobs as listed below.
+
+1. Unit Tests - Runs the test which only need database service.
+2. System Tests - Runs those tests which need complete OpenWhisk system up and running.
+3. Performance test suite - Run basic performance tests with the objective to check if tests are working or not.
+
+These jobs make use of following scripts
+
+1. `scan.sh` - Performs various code scan task like python flake scan, scala formatting etc.
+2. `setupPrereq.sh` - Performs setup if basis prerequisites like database setup and property file generation.
+3. `distDocker.sh` - Builds the various docker containers.
+4. `setupSystem.sh` - Runs the various containers which are part of an OpenWhisk setup like Controller, Invoker etc.
+5. `runTests.sh` - Runs the tests. It make use of `ORG_GRADLE_PROJECT_testSetName` env setting to determine which test
+   suite to run.
+6. `checkAndUploadLogs.sh` -  Collect the logs, check them and then upload them https://app.box.com/v/openwhisk-travis-logs
diff --git a/tools/travis/checkAndUploadLogs.sh b/tools/travis/checkAndUploadLogs.sh
new file mode 100755
index 0000000..781c4a1
--- /dev/null
+++ b/tools/travis/checkAndUploadLogs.sh
@@ -0,0 +1,41 @@
+#!/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.
+#
+
+# Disable abort script at first error as we require the logs to be uploaded
+# even if check and log collection fails
+# set -e
+
+SECONDS=0
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+
+cd $ROOTDIR
+
+LOG_NAME=$1
+TAGS=${2-""}
+LOG_TAR_NAME="${LOG_NAME}_${TRAVIS_BUILD_ID}-$TRAVIS_BRANCH.tar.gz"
+
+ansible-playbook -i ansible/environments/local ansible/logs.yml
+
+./tools/build/checkLogs.py logs "$TAGS"
+
+./tools/travis/box-upload.py "$TRAVIS_BUILD_DIR/logs" "$LOG_TAR_NAME"
+
+echo "Uploaded Logs with name $LOG_TAR_NAME"
+echo "Time taken for ${0##*/} is $SECONDS secs"
diff --git a/tools/travis/distDocker.sh b/tools/travis/distDocker.sh
new file mode 100755
index 0000000..4415fc3
--- /dev/null
+++ b/tools/travis/distDocker.sh
@@ -0,0 +1,30 @@
+#!/bin/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
+
+# Build script for Travis-CI.
+
+SECONDS=0
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+
+cd $ROOTDIR
+TERM=dumb ./gradlew distDocker -PdockerImagePrefix=testing $GRADLE_PROJS_SKIP
+
+echo "Time taken for ${0##*/} is $SECONDS secs"
diff --git a/tools/travis/runSystemTests.sh b/tools/travis/runSystemTests.sh
new file mode 100755
index 0000000..7d1619b
--- /dev/null
+++ b/tools/travis/runSystemTests.sh
@@ -0,0 +1,35 @@
+#!/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_SYSTEM"
+
+./setupPrereq.sh
+
+./distDocker.sh
+
+./setupSystem.sh
+
+./runTests.sh
diff --git a/tools/travis/runTests.sh b/tools/travis/runTests.sh
new file mode 100755
index 0000000..9f53284
--- /dev/null
+++ b/tools/travis/runTests.sh
@@ -0,0 +1,32 @@
+#!/bin/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
+
+# Build script for Travis-CI.
+
+SECONDS=0
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+
+cd $ROOTDIR
+cat whisk.properties
+TERM=dumb ./gradlew :tests:testCoverageLean :tests:reportCoverage
+
+bash <(curl -s https://codecov.io/bash)
+echo "Time taken for ${0##*/} is $SECONDS secs"
diff --git a/tools/travis/runUnitTests.sh b/tools/travis/runUnitTests.sh
new file mode 100755
index 0000000..886c7b2
--- /dev/null
+++ b/tools/travis/runUnitTests.sh
@@ -0,0 +1,35 @@
+#!/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_ONLY_DB"
+
+./scan.sh
+
+./setupPrereq.sh
+
+./distDocker.sh
+
+./runTests.sh
+
diff --git a/tools/travis/scan.sh b/tools/travis/scan.sh
new file mode 100755
index 0000000..a8b6e4c
--- /dev/null
+++ b/tools/travis/scan.sh
@@ -0,0 +1,52 @@
+#!/bin/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
+
+# Build script for Travis-CI.
+SECONDS=0
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+HOMEDIR="$SCRIPTDIR/../../../"
+UTILDIR="$HOMEDIR/incubator-openwhisk-utilities/"
+
+cd $ROOTDIR
+./tools/travis/flake8.sh  # Check Python files for style and stop the build on syntax errors
+
+# clone the openwhisk utilities repo.
+cd $HOMEDIR
+git clone https://github.com/apache/incubator-openwhisk-utilities.git
+
+# run the scancode util. against project source code starting at its root
+cd $UTILDIR
+scancode/scanCode.py --config scancode/ASF-Release-v2.cfg $ROOTDIR
+
+# run scalafmt checks
+cd $ROOTDIR
+TERM=dumb ./gradlew checkScalafmtAll
+
+# lint tests to all be actually runnable
+MISSING_TESTS=$(grep -rL "RunWith" --include="*Tests.scala" tests)
+if [ -n "$MISSING_TESTS" ]
+then
+  echo "The following tests are missing the 'RunWith' annotation"
+  echo $MISSING_TESTS
+  exit 1
+fi
+
+echo "Time taken for ${0##*/} is $SECONDS secs"
diff --git a/tools/travis/setupPrereq.sh b/tools/travis/setupPrereq.sh
new file mode 100755
index 0000000..e53daec
--- /dev/null
+++ b/tools/travis/setupPrereq.sh
@@ -0,0 +1,35 @@
+#!/bin/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
+
+# Build script for Travis-CI.
+SECONDS=0
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+
+cd $ROOTDIR/ansible
+
+$ANSIBLE_CMD setup.yml -e mode=HA
+$ANSIBLE_CMD prereq.yml
+$ANSIBLE_CMD couchdb.yml
+$ANSIBLE_CMD initdb.yml
+$ANSIBLE_CMD wipe.yml
+
+$ANSIBLE_CMD properties.yml
+echo "Time taken for ${0##*/} is $SECONDS secs"
diff --git a/tools/travis/setupSystem.sh b/tools/travis/setupSystem.sh
new file mode 100755
index 0000000..557e0e0
--- /dev/null
+++ b/tools/travis/setupSystem.sh
@@ -0,0 +1,31 @@
+#!/bin/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
+
+# Build script for Travis-CI.
+SECONDS=0
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+
+cd $ROOTDIR/ansible
+
+$ANSIBLE_CMD apigateway.yml
+$ANSIBLE_CMD openwhisk.yml
+
+echo "Time taken for ${0##*/} is $SECONDS secs"

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