Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup hack/test-integration.sh #1412

Merged
merged 1 commit into from
Sep 23, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
57 changes: 28 additions & 29 deletions hack/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,40 @@
# See the License for the specific language governing permissions and
# limitations under the License.

source $(dirname $0)/util.sh
source $(dirname $0)/config-go.sh

function cleanup()
{
set +e
kill ${ETCD_PID} 1>&2 2>/dev/null
rm -rf ${ETCD_DIR} 1>&2 2>/dev/null
echo
echo "Complete"
}
set -o errexit
set -o nounset
set -o pipefail

basedir=$(dirname "$0")
source "${basedir}/config-go.sh"

source "${KUBE_REPO_ROOT}/hack/util.sh"

# Stop right away if the build fails
set -e
cleanup() {
kill "${ETCD_PID-}" >/dev/null 2>&1 || :
rm -rf "${ETCD_DIR-}"
echo ""
echo "Complete"
}

if [[ -z $KUBE_NO_BUILD_INTEGRATION ]]; then
$(dirname $0)/build-go.sh cmd/integration
if [[ "${KUBE_NO_BUILD_INTEGRATION+set}" != "set" ]]; then
"${KUBE_REPO_ROOT}/hack/build-go.sh" cmd/integration
fi

start_etcd
# Run cleanup to stop etcd on interrupt or other kill signal.
trap cleanup HUP INT QUIT TERM

trap cleanup EXIT SIGINT
start_etcd

echo
echo Integration test cases ...
echo
echo ""
echo "Integration test cases..."
echo ""
GOFLAGS="-tags 'integration no-docker'" \
${KUBE_REPO_ROOT}/hack/test-go.sh test/integration
# leave etcd running if integration tests fail
trap "echo etcd still running" EXIT
"${KUBE_REPO_ROOT}/hack/test-go.sh" test/integration

echo
echo Integration scenario ...
echo
${KUBE_TARGET}/bin/integration
echo ""
echo "Integration scenario ..."
echo ""
"${KUBE_TARGET}/bin/integration"

# nuke etcd
trap cleanup EXIT SIGINT
cleanup