Skip to content

Make TestWorkflowEnvironment return errors with stack traces #1395

@recht

Description

@recht
Contributor

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.

Activity

cretz

cretz commented on Feb 26, 2024

@cretz
Member

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @cretz@recht

      Issue actions

        Make TestWorkflowEnvironment return errors with stack traces · Issue #1395 · temporalio/sdk-go