Skip to content

Commit

Permalink
Testing updates (#317)
Browse files Browse the repository at this point in the history
* First of several changes
* Can't do substitution before the param is set - merge things
  • Loading branch information
lesv committed Aug 31, 2016
1 parent ace9bdb commit 70855c7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
32 changes: 23 additions & 9 deletions java-repo-tools/scripts/test-localhost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 12 additions & 0 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 70855c7

Please sign in to comment.