Skip to content

correct guidance for building e2e.test with debug symbols #8397

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

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

BenTheElder
Copy link
Member

Which issue(s) this PR fixes:

Fixes # N/A

DBG=1 enables these settings and also disables stripping the binaries. The current instructions do not produce a debuggable binary.

NOTE: this change does produce a binary that can be debugged, the next bit about using it with "ginkgo.sh" is also wrong but I'm not done iterating on that part. I filed this to avoid forgetting fixing the part which I know the correct fix for already.

/cc @pohly @aojea

@k8s-ci-robot k8s-ci-robot requested review from aojea and pohly March 25, 2025 19:45
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/developer-guide Issues or PRs related to the developer guide approved Indicates a PR has been approved by an approver from all required OWNERS files. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 25, 2025
make WHAT=test/e2e/e2e.test GOGCFLAGS="all=-N -l" GOLDFLAGS=""
# DBG=1 enables necessary debug options and disables stripping binaries
# see the makefile upstream, or use UBE_VERBOSE=3 to get the actual build commands
make WHAT=test/e2e/e2e.test DBG=1
```

Then set the env var `E2E_TEST_DEBUG_TOOL=delve` and then run the test with `./hack/ginkgo.sh` instead of `kubetest`, you should see the delve command line prompt
Copy link
Member Author

@BenTheElder BenTheElder Mar 25, 2025

Choose a reason for hiding this comment

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

Suggested change
Then set the env var `E2E_TEST_DEBUG_TOOL=delve` and then run the test with `./hack/ginkgo.sh` instead of `kubetest`, you should see the delve command line prompt
Then set the env var `E2E_TEST_DEBUG_TOOL=dlv` and then run the test with `./hack/ginkgo-e2e.sh` instead of `kubetest`, you should see the delve command line prompt
  1. dlv not delve AFAICT (the CLI != the project name)
  2. ginkgo-e2e.sh, not ginkgo.sh

That's also not enough to get it to actually work though, E2E_TEST_DEBUG_TOOL=dlv KUBERNETES_PROVIDER=skeleton ./hack/ginkgo-e2e.sh --ginkgo.focus="HTTP.proxy" fails with no output.

KUBERNETES_PROVIDER=skeleton ./hack/ginkgo-e2e.sh --ginkgo.focus="HTTP.proxy" works.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add it there?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't fully get this sorted out, patrick indicated that he's not actually using this mode and is running the binaries directly ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, we can followup on it.

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Minor nits.

make WHAT=test/e2e/e2e.test GOGCFLAGS="all=-N -l" GOLDFLAGS=""
# DBG=1 enables necessary debug options and disables stripping binaries
# see the makefile upstream, or use UBE_VERBOSE=3 to get the actual build commands
make WHAT=test/e2e/e2e.test DBG=1
```

Then set the env var `E2E_TEST_DEBUG_TOOL=delve` and then run the test with `./hack/ginkgo.sh` instead of `kubetest`, you should see the delve command line prompt
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add it there?

Co-authored-by: Maciej Szulik <soltysh@gmail.com>
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm
/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 16, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 16, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, soltysh

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 540d99b into kubernetes:master Apr 16, 2025
3 checks passed
@BenTheElder BenTheElder deleted the update-debug-docs branch April 16, 2025 17:03
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. area/developer-guide Issues or PRs related to the developer guide cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants