Skip to content

Commit

Permalink
Dump kind logs after e2e tests (#4987)
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored Jan 30, 2020
1 parent 5d05e19 commit 1119281
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions test/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

KIND_LOG_LEVEL="0"
KIND_LOG_LEVEL="1"

if ! [ -z $DEBUG ]; then
set -x
Expand All @@ -25,6 +25,18 @@ set -o errexit
set -o nounset
set -o pipefail

cleanup() {
if [[ "${KUBETEST_IN_DOCKER:-}" == "true" ]]; then
kind "export" logs --name ${KIND_CLUSTER_NAME} "${ARTIFACTS}/logs" || true
fi

kind delete cluster \
--verbosity=${KIND_LOG_LEVEL} \
--name ${KIND_CLUSTER_NAME}
}

trap cleanup EXIT

if ! command -v parallel &> /dev/null; then
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "Parallel is not installed. Use the package manager to install it"
Expand Down Expand Up @@ -56,6 +68,7 @@ kind create cluster \
--verbosity=${KIND_LOG_LEVEL} \
--name ${KIND_CLUSTER_NAME} \
--config ${DIR}/kind.yaml \
--retain \
--image "kindest/node:${K8S_VERSION}"

echo "Kubernetes cluster:"
Expand Down Expand Up @@ -86,7 +99,3 @@ kind load docker-image --name="${KIND_CLUSTER_NAME}" ${REGISTRY}/httpbin:${TAG}

echo "[dev-env] running e2e tests..."
make -C ${DIR}/../../ e2e-test

kind delete cluster \
--verbosity=${KIND_LOG_LEVEL} \
--name ${KIND_CLUSTER_NAME}

0 comments on commit 1119281

Please sign in to comment.