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

Dump events from e2e tests #14069

Merged
merged 1 commit into from
May 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this debug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's worth moving at "debug". More often than not when debugging e2e I would prefer to see by default that a file with all the events has been placed somewhere. It's the same level as the dump we get from etcd, too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. We still get debug level in the scripts.log artifact but OK.

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