File tree 1 file changed +52
-0
lines changed
1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # Copyright 2016 Google Inc. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # Usage:
17
+ # test-devserver.sh path/to/project
18
+ #
19
+ # This script runs the local appengine:devserver Maven plugin and verifies that
20
+ # a request to http://localhost:8080/ does not return an error code.
21
+ #
22
+ # As an example, this is useful for verifying that datastore-indexes.xml is
23
+ # correct (only if autoGenerate=false and the / handler does all queries used),
24
+ # as an example.
25
+
26
+ set -e
27
+ set -x
28
+
29
+ if [ -z " $1 " ]; then
30
+ echo " Missing directory parameter."
31
+ echo " Usage:"
32
+ echo " $0 path/to/project"
33
+ exit 1
34
+ fi
35
+
36
+ (
37
+ cd " $1 "
38
+ expect -c '
39
+ spawn mvn --batch-mode clean appengine:devserver -DskipTests
40
+ set timeout 600
41
+ expect localhost:8080
42
+ sleep 10
43
+ spawn curl --silent --output /dev/stderr --write-out "%{http_code}" http://localhost:8080/
44
+ expect {
45
+ "200" {
46
+ exit
47
+ }
48
+ }
49
+ exit 1
50
+ '
51
+ )
52
+
You can’t perform that action at this time.
0 commit comments