forked from LaconicNetwork/kompose
This adds cluster tests for "kompose up" and "kompose down" for Kubernetes. At the moment this checks that they are deployable to a single-node Kubernetes cluster. More proficient tests such as testing if the pods are actually up will be added in the future. You can test this by running: `make test-ci` on your local-machine. Furthermore, we'll eventually have this enabled on Fabric8 / CentOS CI / Semaphore (whatever comes first) so we can have a full end-to-end testing environment.
39 lines
864 B
Bash
Executable File
39 lines
864 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# These tests will bring up a single-node Kubernetes cluster and test against examples
|
|
# WARNING: This will actively create Docker containers on your machine as well as remove them
|
|
# do not run this on a production cluster / machine.
|
|
|
|
|
|
# Check requirements!
|
|
if ! hash go 2>/dev/null; then
|
|
echo "ERROR: go required"
|
|
exit 0
|
|
fi
|
|
|
|
if ! hash docker 2>/dev/null; then
|
|
echo "ERROR: docker required"
|
|
exit 0
|
|
fi
|
|
|
|
if ! hash kubectl 2>/dev/null; then
|
|
echo "ERROR: kubectl required"
|
|
exit 0
|
|
fi
|
|
|
|
# First off, we have to compile the latest binary
|
|
make bin
|
|
|
|
#####################
|
|
# KUBERNETES TESTS ##
|
|
#####################
|
|
|
|
# Now we can start our Kubernetes cluster!
|
|
./script/test_ci/kubernetes.sh start
|
|
|
|
# And we're off! Let's test those example files
|
|
./script/test_ci/kubernetes.sh test
|
|
|
|
# Stop our Kubernetes cluster
|
|
./script/test_ci/kubernetes.sh stop
|