Skip to content

Commit 70855c7

Browse files
authored
Testing updates (GoogleCloudPlatform#317)
* First of several changes * Can't do substitution before the param is set - merge things
1 parent ace9bdb commit 70855c7

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

java-repo-tools/scripts/test-localhost.sh

+23-9
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ print_usage () {
2424
echo " $0 server-type path/to/project [-- maven arguments]" >&2
2525
echo >&2
2626
echo "server-type can be any of the following:" >&2
27-
echo " appengine" >&2
28-
echo " jetty" >&2
29-
echo " spring-boot" >&2
27+
echo " appengine - GAE Standard - Local - GA Plugin" >&2
28+
echo " jetty - Flex - Local" >&2
29+
echo " spring-boot - local" >&2
30+
echo " new_mvn - local - Standard / FlexCompat" >&2
31+
echo " gradle - local - Standard / FlexCompat" >&2
32+
echo " gradle_jetty - local - Flex" &2
3033
}
3134

3235
if [[ -z "$1" ]]; then
@@ -36,16 +39,28 @@ if [[ -z "$1" ]]; then
3639
fi
3740
case $1 in
3841
appengine)
39-
mvn_plugin="appengine:devserver"
4042
server_started_message="localhost:8080"
43+
command="mvn --batch-mode clean appengine:devserver -DskipTests"
4144
;;
4245
jetty)
43-
mvn_plugin="jetty:run-exploded"
4446
server_started_message="Started Jetty Server"
47+
command="mvn --batch-mode clean jetty:run-exploded -DskipTests"
4548
;;
4649
spring-boot)
47-
mvn_plugin="spring-boot:run"
4850
server_started_message="Tomcat started on port(s): 8080 (http)"
51+
command="mvn --batch-mode clean spring-boot:run -DskipTests"
52+
;;
53+
new_mvn)
54+
server_started_message="localhost:8080"
55+
command="mvn --batch-mode clean appengine:run -DskipTests"
56+
;;
57+
gradle)
58+
server_started_message="localhost:8080"
59+
command="gradle appengineRun"
60+
;;
61+
gradle_jetty)
62+
server_started_message="localhost:8080"
63+
command="gradle jettyRun"
4964
;;
5065
*)
5166
print_usage
@@ -60,11 +75,10 @@ if [[ -z "$2" ]]; then
6075
fi
6176
code_path=$2
6277

63-
mvn_command="mvn --batch-mode clean ${mvn_plugin} -DskipTests"
6478
if [[ "$3" == "--" ]]; then
6579
shift 3
6680
for mvn_arg in "${@}"; do
67-
mvn_command="${mvn_command} ${mvn_arg}"
81+
command="${command} ${mvn_arg}"
6882
done
6983
elif [[ -n "$3" ]]; then
7084
echo "Got unexpected third argument" >&2
@@ -78,7 +92,7 @@ set -x
7892
(
7993
cd "$code_path"
8094
expect -c "
81-
spawn ${mvn_command}
95+
spawn ${command}
8296
set timeout 600
8397
expect \"${server_started_message}\"
8498
"'sleep 10

travis.sh

+12
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ set -x
1919
set -o pipefail
2020
shopt -s globstar
2121

22+
add_ppa 'ppa:cwchien/gradle'
23+
sudo apt-get -qqy install gradle-3.0
24+
2225
SKIP_TESTS=false
2326
if [ -z "$GOOGLE_APPLICATION_CREDENTIALS" ] ; then
2427
SKIP_TESTS=true
@@ -37,6 +40,15 @@ for testdir in "${devserver_tests[@]}" ; do
3740
./java-repo-tools/scripts/test-localhost.sh appengine "${testdir}"
3841
done
3942

43+
newplugin_std_tests=(
44+
# appengine/helloworld-new-plugins
45+
)
46+
for testdir in "${newplugin_std_tests[@]}" ; do
47+
./java-repo-tools/scripts/test-localhost.sh standard_mvn "${testdir}"
48+
./java-repo-tools/scripts/test-localhost.sh standard_gradle "${testdir}"
49+
done
50+
51+
4052
# Check that all shell scripts in this repo (including this one) pass the
4153
# Shell Check linter.
4254
shellcheck ./**/*.sh

0 commit comments

Comments
 (0)