From 70855c76a49ac337253e0942a23547eb75379f8e Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Wed, 31 Aug 2016 14:31:57 -0700 Subject: [PATCH] Testing updates (#317) * First of several changes * Can't do substitution before the param is set - merge things --- java-repo-tools/scripts/test-localhost.sh | 32 ++++++++++++++++------- travis.sh | 12 +++++++++ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/java-repo-tools/scripts/test-localhost.sh b/java-repo-tools/scripts/test-localhost.sh index 742e0df3aa8..a83f3e20d29 100755 --- a/java-repo-tools/scripts/test-localhost.sh +++ b/java-repo-tools/scripts/test-localhost.sh @@ -24,9 +24,12 @@ print_usage () { echo " $0 server-type path/to/project [-- maven arguments]" >&2 echo >&2 echo "server-type can be any of the following:" >&2 - echo " appengine" >&2 - echo " jetty" >&2 - echo " spring-boot" >&2 + echo " appengine - GAE Standard - Local - GA Plugin" >&2 + echo " jetty - Flex - Local" >&2 + echo " spring-boot - local" >&2 + echo " new_mvn - local - Standard / FlexCompat" >&2 + echo " gradle - local - Standard / FlexCompat" >&2 + echo " gradle_jetty - local - Flex" &2 } if [[ -z "$1" ]]; then @@ -36,16 +39,28 @@ if [[ -z "$1" ]]; then fi case $1 in appengine) - mvn_plugin="appengine:devserver" server_started_message="localhost:8080" + command="mvn --batch-mode clean appengine:devserver -DskipTests" ;; jetty) - mvn_plugin="jetty:run-exploded" server_started_message="Started Jetty Server" + command="mvn --batch-mode clean jetty:run-exploded -DskipTests" ;; spring-boot) - mvn_plugin="spring-boot:run" server_started_message="Tomcat started on port(s): 8080 (http)" + command="mvn --batch-mode clean spring-boot:run -DskipTests" + ;; + new_mvn) + server_started_message="localhost:8080" + command="mvn --batch-mode clean appengine:run -DskipTests" + ;; + gradle) + server_started_message="localhost:8080" + command="gradle appengineRun" + ;; + gradle_jetty) + server_started_message="localhost:8080" + command="gradle jettyRun" ;; *) print_usage @@ -60,11 +75,10 @@ if [[ -z "$2" ]]; then fi code_path=$2 -mvn_command="mvn --batch-mode clean ${mvn_plugin} -DskipTests" if [[ "$3" == "--" ]]; then shift 3 for mvn_arg in "${@}"; do - mvn_command="${mvn_command} ${mvn_arg}" + command="${command} ${mvn_arg}" done elif [[ -n "$3" ]]; then echo "Got unexpected third argument" >&2 @@ -78,7 +92,7 @@ set -x ( cd "$code_path" expect -c " - spawn ${mvn_command} + spawn ${command} set timeout 600 expect \"${server_started_message}\" "'sleep 10 diff --git a/travis.sh b/travis.sh index d9487993774..a97ba058289 100755 --- a/travis.sh +++ b/travis.sh @@ -19,6 +19,9 @@ set -x set -o pipefail shopt -s globstar +add_ppa 'ppa:cwchien/gradle' +sudo apt-get -qqy install gradle-3.0 + SKIP_TESTS=false if [ -z "$GOOGLE_APPLICATION_CREDENTIALS" ] ; then SKIP_TESTS=true @@ -37,6 +40,15 @@ for testdir in "${devserver_tests[@]}" ; do ./java-repo-tools/scripts/test-localhost.sh appengine "${testdir}" done +newplugin_std_tests=( +# appengine/helloworld-new-plugins +) +for testdir in "${newplugin_std_tests[@]}" ; do + ./java-repo-tools/scripts/test-localhost.sh standard_mvn "${testdir}" + ./java-repo-tools/scripts/test-localhost.sh standard_gradle "${testdir}" +done + + # Check that all shell scripts in this repo (including this one) pass the # Shell Check linter. shellcheck ./**/*.sh