GD-1088: Introduce structured stack trace and error model for assertion failures#1099
Open
MikeSchulze wants to merge 3 commits intomasterfrom
Open
GD-1088: Introduce structured stack trace and error model for assertion failures#1099MikeSchulze wants to merge 3 commits intomasterfrom
MikeSchulze wants to merge 3 commits intomasterfrom
Conversation
4 tasks
…on failures
# Why
Assertion failures previously only captured a line number via an ad-hoc
stack scan in `GdUnitAssertions.get_line_number()`. This made it impossible
to inspect or verify the full call stack when a failure occurred, limiting
diagnostics and making failure assertions (`assert_failure`) unable to
verify stack context.
# What
- Introduce three new types: `GdStackTraceElement` (single frame), `GdUnitStackTrace`
(filtered test-side call stack), and `GdUnitError` (bundles message, line number,
and stack trace). These replace the ad-hoc `GdUnitAssertions.get_line_number()`
static helper which only extracted a single line number from the raw `get_stack()`
result.
- Propagate `GdUnitError` through the full reporting pipeline: assert impls construct
it at failure time, `GdAssertReports.report_error()` stores it on the execution
context and attaches it to `GdUnitReport`, making the complete stack trace
retrievable after the fact — not just the message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Assertion failures previously only captured a line number via an ad-hoc
stack scan in
GdUnitAssertions.get_line_number(). This made it impossibleto inspect or verify the full call stack when a failure occurred, limiting
diagnostics and making failure assertions (
assert_failure) unable toverify stack context.
What
GdStackTraceElement(single frame),GdUnitStackTrace(filtered test-side call stack), andGdUnitError(bundles message, line number, and stack trace). These replace the ad-hocGdUnitAssertions.get_line_number()static helper which only extracted a single line number from the rawget_stack()result.GdUnitErrorthrough the full reporting pipeline: assert impls construct it at failure time,GdAssertReports.report_error()stores it on the execution context and attaches it toGdUnitReport, making the complete stack trace retrievable after the fact — not just the message.