Merge pull request #1412 from filbranden/test_integration1

Cleanup hack/test-integration.sh
pull/6/head
Joe Beda 2014-09-23 09:58:26 -07:00
commit 6df5afb88e
1 changed files with 27 additions and 28 deletions

View File

@ -14,41 +14,40 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
source $(dirname $0)/util.sh set -o errexit
source $(dirname $0)/config-go.sh set -o nounset
set -o pipefail
function cleanup() basedir=$(dirname "$0")
{ source "${basedir}/config-go.sh"
set +e
kill ${ETCD_PID} 1>&2 2>/dev/null source "${KUBE_REPO_ROOT}/hack/util.sh"
rm -rf ${ETCD_DIR} 1>&2 2>/dev/null
echo cleanup() {
echo "Complete" kill "${ETCD_PID-}" >/dev/null 2>&1 || :
rm -rf "${ETCD_DIR-}"
echo ""
echo "Complete"
} }
# Stop right away if the build fails if [[ "${KUBE_NO_BUILD_INTEGRATION+set}" != "set" ]]; then
set -e "${KUBE_REPO_ROOT}/hack/build-go.sh" cmd/integration
if [[ -z $KUBE_NO_BUILD_INTEGRATION ]]; then
$(dirname $0)/build-go.sh cmd/integration
fi fi
# Run cleanup to stop etcd on interrupt or other kill signal.
trap cleanup HUP INT QUIT TERM
start_etcd start_etcd
trap cleanup EXIT SIGINT echo ""
echo "Integration test cases..."
echo echo ""
echo Integration test cases ...
echo
GOFLAGS="-tags 'integration no-docker'" \ GOFLAGS="-tags 'integration no-docker'" \
${KUBE_REPO_ROOT}/hack/test-go.sh test/integration "${KUBE_REPO_ROOT}/hack/test-go.sh" test/integration
# leave etcd running if integration tests fail
trap "echo etcd still running" EXIT
echo echo ""
echo Integration scenario ... echo "Integration scenario ..."
echo echo ""
${KUBE_TARGET}/bin/integration "${KUBE_TARGET}/bin/integration"
# nuke etcd cleanup
trap cleanup EXIT SIGINT