Skip to content

Commit

Permalink
Merge pull request #1730 from r2d4/print-debug
Browse files Browse the repository at this point in the history
Add some debugging output when the tests fail
  • Loading branch information
r2d4 authored Jul 24, 2017
2 parents b3d68f5 + 0aa9c3b commit 6eeda22
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hack/jenkins/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ sudo rm -rf $HOME/.kube || true

# Allow this to fail, we'll switch on the return code below.
set +e
${SUDO_PREFIX}out/e2e-${OS_ARCH} -minikube-args="--vm-driver=${VM_DRIVER} --v=10" -test.v -test.timeout=30m -binary=out/minikube-${OS_ARCH}
${SUDO_PREFIX}out/e2e-${OS_ARCH} -minikube-args="--vm-driver=${VM_DRIVER} --v=10 --logtostderr" -test.v -test.timeout=30m -binary=out/minikube-${OS_ARCH}
result=$?
set -e

Expand All @@ -85,6 +85,7 @@ if [[ $result -eq 0 ]]; then
status="success"
else
status="failure"
source print-debug-info.sh
fi

set +x
Expand Down
35 changes: 35 additions & 0 deletions hack/jenkins/print-debug-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Prints some debug info about the state of the cluster
#
# We don't check the error on these commands, since they might fail depending on
# the cluster state.
set +e

kubectl get pods --all-namespaces
kubectl cluster-info dump

docker ps

MINIKUBE=${SUDO_PREFIX}out/minikube-${OS_ARCH}
${MINIKUBE} status
${MINIKUBE} ip
${MINIKUBE} ssh -- cat /etc/VERSION
${MINIKUBE} ssh -- docker ps
${MINIKUBE} logs

set -e

0 comments on commit 6eeda22

Please sign in to comment.