Skip to content

Commit

Permalink
Merge pull request #14069 from kargakis/dump-events-from-e2e-tests
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored May 9, 2017
2 parents 9063c2c + 61dc793 commit 31caa0d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
20 changes: 19 additions & 1 deletion hack/lib/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,22 @@ function os::cleanup::tmpdir() {
${USE_SUDO:+sudo} rm -rf "${directory}"
done
}
readonly -f os::cleanup::tmpdir
readonly -f os::cleanup::tmpdir

# os::cleanup::dump_events dumps all the events from a cluster to a file.
#
# Globals:
# ARTIFACT_DIR
# Arguments:
# None
# Returns:
# None
function os::cleanup::dump_events() {
os::log::info "Dumping cluster events to ${ARTIFACT_DIR}/events.txt"
local kubeconfig
if [[ -n "${ADMIN_KUBECONFIG}" ]]; then
kubeconfig="--config=${ADMIN_KUBECONFIG}"
fi
oc get events --all-namespaces ${kubeconfig} > "${ARTIFACT_DIR}/events.txt"
}
readonly -f os::cleanup::dump_events
2 changes: 2 additions & 0 deletions hack/test-end-to-end-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function cleanup()

os::cleanup::dump_etcd

os::cleanup::dump_events

if [[ -z "${SKIP_TEARDOWN-}" ]]; then
os::cleanup::containers
fi
Expand Down
1 change: 1 addition & 0 deletions hack/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function cleanup_openshift() {

if [[ -z "${SKIP_TEARDOWN-}" ]]; then
os::cleanup::dump_etcd
os::cleanup::dump_events
os::log::info "Tearing down test"
kill_all_processes

Expand Down

0 comments on commit 31caa0d

Please sign in to comment.