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
Ginkgo update + stack fix #82176
Ginkgo update + stack fix #82176
Conversation
This is WIP because Ginkgo 1.10.0 still isn't quite working correctly: onsi/ginkgo#600 |
/retest |
test/e2e/framework/log/logger.go
Outdated
@@ -48,8 +51,9 @@ func Failf(format string, args ...interface{}) { | |||
// (for example, for call chain f -> g -> FailfWithOffset(1, ...) error would be logged for "f"). |
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.
nit: nice to add Stack Trace
also in this explanation.
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.
Done.
@@ -19,6 +19,9 @@ package log | |||
|
|||
import ( |
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.
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.
I see. I've moved it and also some of the util.go
functions that are only used in log.go
. I also updated the comment in framework/e2e/log/logger.go
to be more explicit.
test/e2e/framework/log/logger.go
Outdated
// entries coming from Ginkgo. | ||
// | ||
// This is a copy of https://github.com/onsi/ginkgo/blob/f90f37d87fa6b1dd9625e2b1e83c23ffae3de228/internal/codelocation/code_location.go#L25 | ||
func PrunedStack(skip int) string { |
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.
The original function name is PruneStack in ginkgo. I guess this name (with d
) is intentional, right?
(I tried to search this name in ginkgo repo, and I missed that with the name)
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.
I intentionally renamed it, because this version is simpler and returns the "pruned stack" instead of taking an arbitrary string and pruning it.
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.
I added "This is a modified copy of PruneStack in ..."
/cc @oomichi |
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.
/approve
/assign @liggitt |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, oomichi, pohly, timothysc 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 |
@pohly could you try doing a |
/test all |
Updated to keep both Ginkgo and Gomega at the latest releases.
84ea6c0
to
27b9a9c
Compare
Done. @alejandrox1 now you need to LGTM again. |
/lgtm |
/retest Review the full test history for this PR. Silence the bot with an |
Ginkgo update + stack fix Kubernetes-commit: b140b43
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
After merging
259bb3b#diff-eb7b79470992813ea1905e96c298b47b
ExpectEqual and some of the other wrappers logged the failure twice,
once inside the wrapper itself and once in the failure handler.
Logging the stack backtrace is useful because many assertions still
don't contain an explanation and therefore knowing where they occur is
crucial. Now all failures are logged with a "Full Stack Trace", not
just those with a wrapper. The stack is pruned to skip over wrapper
functions and removes Ginkgo internal functions to keep the stack
trace smaller.
Failures occurring in the wrappers were recorded as occurring in those
wrappers. Now the wrappers are skipped and the caller is recorded
instead.
Fixes: #82013
Does this PR introduce a user-facing change?: