jonpspri commented on a change in pull request #184: Create tarball for Nginx 
container in OpenWhisk as part of release deploy script
URL: 
https://github.com/apache/incubator-openwhisk-cli/pull/184#discussion_r162832837
 
 

 ##########
 File path: tools/travis/test_openwhisk.sh
 ##########
 @@ -2,57 +2,85 @@
 
 set -e
 
-cd $TRAVIS_BUILD_DIR
-./tools/travis/scancode.sh
-make lint
-make build
-make test
-export PATH=$PATH:$TRAVIS_BUILD_DIR;
-make native_test;
-
-export OPENWHISK_HOME="$(dirname "$TRAVIS_BUILD_DIR")/incubator-openwhisk";
+#
+#  At this point, the Travis build should already have built the binaries and
+#  the release.  If you're running manually, this command should get you to
+#  the same place:
+#
+#    ./gradlew buildBinaries release
+#
+#  Also at this point, you should already have incubator-openwhisk pulled down
+#  from gradle in the parent directory, using a command such as:
+#
+#    git clone --depth 3 https://github.com/apache/incubator-openwhisk.git
+#
+#  To be clear, your directory structure will look something like...
+#
+#      $HOMEDIR
+#       |- incubator-openwhisk
+#       |- incubator-openwhisk-cli (This project)
+#       |- incubator-openwhisk-utilities (For scancode)
+#
+#  The idea is to only build once and to be transparent about building in
+#  the Travis script.  To that end, some of the other builds that had been
+#  done in this script will be moved into Travis.yml.
+#
+
+#
+#  Figure out default directories, etc., so we're not beholden to Travis
+#  when running tests of the script.
+#
+scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+TRAVIS_BUILD_DIR="$( cd "${TRAVIS_BUILD_DIR:-$scriptdir/../..}" && pwd )"
+export TRAVIS_BUILD_DIR
+
+# For the gradle builds.
 HOMEDIR="$(dirname "$TRAVIS_BUILD_DIR")"
-cd $HOMEDIR
+OPENWHISK_HOME="$( cd "${OPENWHISK_HOME:-$HOMEDIR/incubator-openwhisk}" && pwd 
)"
+export OPENWHISK_HOME
 
-# Clone the OpenWhisk code
-git clone --depth 3 https://github.com/apache/incubator-openwhisk.git
+#
+#  These are the basic tests
+#
+../incubator-openwhisk-utilities/scancode/scanCode.py $TRAVIS_BUILD_DIR
 
-# Build script for Travis-CI.
-WHISKDIR="$HOMEDIR/incubator-openwhisk"
+#  Run separate test scopes as separate
+./gradlew --console=plain goLint
+./gradlew --console=plain goTest -PgoTags=unit
+export PATH=$PATH:$TRAVIS_BUILD_DIR
+./gradlew --console=plain goTest -PgoTags=native
 
-cd $WHISKDIR
-./tools/travis/setup.sh
+#  Set up the OpenWhisk environment for integration testing
+cd $OPENWHISK_HOME
+#./tools/travis/setup.sh  ### WARNING -- this script has sudo and privileged 
writes
 
 ANSIBLE_CMD="ansible-playbook -i environments/local -e 
docker_image_prefix=testing"
-TERM=dumb ./gradlew distDocker -PdockerImagePrefix=testing
+./gradlew --console=plain distDocker -PdockerImagePrefix=testing
 
-cd $WHISKDIR/ansible
+cd $OPENWHISK_HOME/ansible
 $ANSIBLE_CMD setup.yml
 $ANSIBLE_CMD prereq.yml
 $ANSIBLE_CMD couchdb.yml
 $ANSIBLE_CMD initdb.yml
 $ANSIBLE_CMD apigateway.yml
-
-cd $TRAVIS_BUILD_DIR
-TERM=dumb ./gradlew buildBinaries
-
-cd $WHISKDIR/ansible
 $ANSIBLE_CMD wipe.yml
 $ANSIBLE_CMD openwhisk.yml -e openwhisk_cli_home=$TRAVIS_BUILD_DIR
 
 # Copy the binary generated into the OPENWHISK_HOME/bin, so that the test 
cases will run based on it.
-mkdir -p $WHISKDIR/bin
-cp $TRAVIS_BUILD_DIR/bin/wsk $WHISKDIR/bin
+# TODO - if the ansible above were correctly configured, this wouldn't be 
necessary
+mkdir -p $OPENWHISK_HOME/bin
+cp -f $TRAVIS_BUILD_DIR/bin/wsk $OPENWHISK_HOME/bin
 
 Review comment:
   Agreed.  Will work it through.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to