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

Make TestWorkflowEnvironment return errors with stack traces #1395

Open
recht opened this issue Feb 22, 2024 · 1 comment · May be fixed by #1396
Open

Make TestWorkflowEnvironment return errors with stack traces #1395

recht opened this issue Feb 22, 2024 · 1 comment · May be fixed by #1396
Labels
enhancement New feature or request

Comments

@recht
Copy link
Contributor

recht commented Feb 22, 2024

If a test fails, for example because a context is used wrongly, there's almost no information available to debug, and you have to go through error unwrapping and checking in order to get to a usable stacktrace.

The usual solution is to implement a Format function on errors that prints more information when formatted using %+v. Functions like require.NoError also use this, so if there is a verbose version then that will be printed.

@recht recht added the enhancement New feature or request label Feb 22, 2024
@cretz
Copy link
Member

cretz commented Feb 26, 2024

If a test fails, for example because a context is used wrongly, there's almost no information available to debug

Are you setting logging in this test environment? Go errors are often short on this kind of information when just printed directly and encourage logging or explicit error extraction to fill in the gaps here. If we are not logging information that we should, we can make sure we do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants