-
Notifications
You must be signed in to change notification settings - Fork 552
test/e2e: Support logging individual resources' state to stdout #2519
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
test/e2e: Support logging individual resources' state to stdout #2519
Conversation
@@ -127,6 +128,32 @@ func (ctx TestContext) DumpNamespaceArtifacts(namespace string) error { | |||
return nil | |||
} | |||
|
|||
func (ctx TestContext) DescribeResource(command string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be largely be useful to dump out resources (or container logs) when you run into a failed test case:
if CurrentGinkgoTestDescription().Failed {
ctx.Ctx().DescribeResource(fmt.Sprintf("kubectl get operators %s -o yaml", o.GetName()))
ctx.Ctx().DescribeResource(fmt.Sprintf("kubectl -n %s logs -l app=olm-operator --tail=50 --prefix --timestamps", *olmNamespace))
}
I put the fix for the unit test failure in #2521 |
/lgtm Nice, I like the approach here. |
18f1d3e
to
4ff336e
Compare
New changes are detected. LGTM label has been removed. |
4ff336e
to
a312e1d
Compare
/approve |
a312e1d
to
f67d640
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: perdasilva, timflannagan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
f67d640
to
070e43c
Compare
070e43c
to
6735ffb
Compare
6735ffb
to
e7f7d81
Compare
b7d37f6
to
20f842c
Compare
Add initial support for debugging individual Kubernetes resources, executing arbitrary shell commands, etc. This is mainly useful in the context of debugging cluster-scoped resources (e.g. the Operator API) that don't necessary fit into the test/e2e/collect-ci-artifacts.sh gather script. Signed-off-by: timflannagan <[email protected]>
20f842c
to
7b27540
Compare
Add initial support for debugging individual Kubernetes resources,
executing arbitrary shell commands, etc. This is mainly useful in the
context of debugging cluster-scoped resources (e.g. the Operator API)
that don't necessary fit into the test/e2e/collect-ci-artifacts.sh
gather script.
Signed-off-by: timflannagan [email protected]
Description of the change:
Motivation for the change:
Reviewer Checklist
/doc