Skip to content
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

Render stacktrace for concrete exceptions in failing tests #368

Closed
EgorkaKulikov opened this issue Jul 1, 2022 · 0 comments · Fixed by #477
Closed

Render stacktrace for concrete exceptions in failing tests #368

EgorkaKulikov opened this issue Jul 1, 2022 · 0 comments · Fixed by #477
Assignees
Labels
comp-codegen Issue is related to code generator ctg-enhancement New feature, improvement or change request

Comments

@EgorkaKulikov
Copy link
Collaborator

Description

We should show in generated code the full or partial stack trace of exception in concrete execution.

Expected behavior

If concrete execution fails with implicit exception (unexpected NPE, for example), we generate a green or red test, depending on plugin settings. If such tests should be red, we generate a warning that the current test fails with an exception.

But often not only the exception type is useful, but also its stack trace. So, the suggestion is to render the exception stack trace too, but separate it for developing and production - a user needs only user code methods from stack trace but concrete methods invocations from stack trace could be useful for debugging.

Context

Migrated from JIRA, issue 1644.
Look at CgMethodConstructor.writeWarningAboutFailureTest method

@EgorkaKulikov EgorkaKulikov added ctg-enhancement New feature, improvement or change request comp-codegen Issue is related to code generator labels Jul 1, 2022
@EgorkaKulikov EgorkaKulikov self-assigned this Jul 1, 2022
@EgorkaKulikov EgorkaKulikov moved this to Todo in UTBot Java Jul 1, 2022
@sofurihafe sofurihafe self-assigned this Jul 8, 2022
@sofurihafe sofurihafe linked a pull request Jul 11, 2022 that will close this issue
Repository owner moved this from Todo to Done in UTBot Java Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-codegen Issue is related to code generator ctg-enhancement New feature, improvement or change request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants