Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#4 from monopole/tweakIntegrationTest
Browse files Browse the repository at this point in the history
demoReorgToEaseTesting
  • Loading branch information
monopole committed May 15, 2018
2 parents 831bd5d + 9bc92f1 commit fd3262c
Show file tree
Hide file tree
Showing 33 changed files with 31 additions and 20 deletions.
8 changes: 4 additions & 4 deletions demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
These demos assume that `kustomize` is on your `$PATH`.
They are covered by pre-submit tests.

* [hello world](helloWorld.md) - Deploy multiple
* [hello world](helloWorld/README.md) - Deploy multiple
(differently configured) variants of a simple Hello
World server.

* [LDAP](ldap.md) - Deploy multiple
* [LDAP](ldap/README.md) - Deploy multiple
(differently configured) variants of a LDAP server.

* [mySql](mySql.md) - Create a MySQL production
* [mySql](mySql/README.md) - Create a MySQL production
configuration from scratch.

* [springboot](springboot.md) - Create a Spring Boot
* [springboot](springboot/README.md) - Create a Spring Boot
application production configuration from scratch.

* [configGeneration](configGeneration.md) -
Expand Down
2 changes: 1 addition & 1 deletion demos/helloWorld.md → demos/helloWorld/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mkdir -p $BASE
curl -s -o "$BASE/#1.yaml" "https://raw.githubusercontent.com\
/kubernetes-sigs/kustomize\
/master/demos/data/helloWorld\
/master/demos/helloWorld\
/{configMap,deployment,kustomization,service}.yaml"
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 23 additions & 12 deletions test/main.sh → demos/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.


# This script run periodically by kubernetes test-infra.
# At time of writing, it's 'call point' was in
# https://github.com/kubernetes/test-infra/blob/master/jobs/config.json

function exit_with {
local msg=$1
echo >&2 ${msg}
Expand All @@ -22,25 +27,31 @@ function exit_with {

base_dir="$( cd "$(dirname "$0")/../../.." && pwd )"
cd "$base_dir" || {
echo "Cannot cd to '$base_dir'. Aborting." >&2
exit 1
exit_with "Cannot cd to ${base_dir}. Aborting."
}

# Install kustomize to $GOPATH/bin and export PATH
go install ./cmd/kustomize || { exit_with "Failed to install kustomize"; }
go install github.com/kubernetes-sigs/kustomize || \
{ exit_with "Failed to install kustomize"; }
export PATH=$GOPATH/bin:$PATH

home=`pwd`
example_dir="./cmd/kustomize/demos/data/ldap/base"
if [ ! -d ${example_dir} ]; then
exit_with "directory ${example_dir} doesn't exist"

### LDAP TEST ###
demo_dir="./demos/ldap"
if [ ! -d ${demo_dir} ]; then
exit_with "directory ${demo_dir} doesn't exist"
fi

if [ -x "${example_dir}/tests/test.sh" ]; then
${example_dir}/tests/test.sh ${example_dir}
test_script="${demo_dir}/integration_test.sh"

if [ -x "${test_script}" ]; then
${test_script} ${demo_dir}/base
if [ $? -eq 0 ]; then
echo "testing ${example_dir} passed."
echo "testing ${demo_dir} passed."
else
exit_with "testing ${example_dir} failed."
exit_with "testing ${demo_dir} failed."
fi
fi
else
exit_with "Unable to run ${test_script}"
fi
#################
2 changes: 1 addition & 1 deletion demos/ldap.md → demos/ldap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mkdir -p $BASE
CONTENT="https://raw.githubusercontent.com\
/kubernetes-sigs/kustomize\
/master/demos/data/ldap"
/master/demos/ldap"
curl -s -o "$BASE/#1" "$CONTENT/base\
/{deployment.yaml,kustomization.yaml,service.yaml,env.startup.txt}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion demos/mySql.md → demos/mySql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Download them:
```
curl -s -o "$DEMO_HOME/#1.yaml" "https://raw.githubusercontent.com\
/kubernetes-sigs/kustomize\
/master/demos/data/mySql\
/master/demos/mySql\
/{deployment,secret,service}.yaml"
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion demos/springboot.md → demos/springboot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Download them:
```
CONTENT="https://raw.githubusercontent.com\
/kubernetes-sigs/kustomize\
/master/demos/data/springboot"
/master/demos/springboot"
curl -s -o "$DEMO_HOME/#1.yaml" \
"$CONTENT/base/{deployment,service}.yaml"
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit fd3262c

Please sign in to comment.