Skip to content

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

Conversation

timflannagan
Copy link
Member

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

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive

@openshift-ci openshift-ci bot requested review from anik120 and dinhxuanvu December 10, 2021 21:48
@@ -127,6 +128,32 @@ func (ctx TestContext) DumpNamespaceArtifacts(namespace string) error {
return nil
}

func (ctx TestContext) DescribeResource(command string) error {
Copy link
Member Author

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))
}

@timflannagan timflannagan changed the title test/e2e: Support logging an individual resources' state to stdout test/e2e: Support logging individual resources' state to stdout Dec 11, 2021
@akihikokuroda
Copy link
Member

I put the fix for the unit test failure in #2521

@tylerslaton
Copy link
Contributor

/lgtm

Nice, I like the approach here.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2021
@timflannagan timflannagan force-pushed the ci/add-resource-debugging-support branch from 18f1d3e to 4ff336e Compare January 4, 2022 19:08
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 4, 2022
@openshift-ci
Copy link

openshift-ci bot commented Jan 4, 2022

New changes are detected. LGTM label has been removed.

@timflannagan timflannagan force-pushed the ci/add-resource-debugging-support branch from 4ff336e to a312e1d Compare January 4, 2022 19:10
@perdasilva
Copy link
Collaborator

/approve

@timflannagan timflannagan force-pushed the ci/add-resource-debugging-support branch from a312e1d to f67d640 Compare February 17, 2022 16:52
@openshift-ci
Copy link

openshift-ci bot commented Feb 17, 2022

[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:
  • OWNERS [perdasilva,timflannagan]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 17, 2022
@timflannagan timflannagan force-pushed the ci/add-resource-debugging-support branch from f67d640 to 070e43c Compare February 17, 2022 18:17
@timflannagan timflannagan force-pushed the ci/add-resource-debugging-support branch from 070e43c to 6735ffb Compare March 2, 2022 22:16
@timflannagan timflannagan force-pushed the ci/add-resource-debugging-support branch from 6735ffb to e7f7d81 Compare April 25, 2022 15:55
@timflannagan timflannagan force-pushed the ci/add-resource-debugging-support branch from b7d37f6 to 20f842c Compare July 28, 2022 18:57
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]>
@awgreene awgreene force-pushed the ci/add-resource-debugging-support branch from 20f842c to 7b27540 Compare September 3, 2022 15:10
@timflannagan timflannagan deleted the ci/add-resource-debugging-support branch September 10, 2022 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants