Skip to content

[Before(Test)] hooks don't report useful errors in VS (Code) or Rider #3374

@JohnGalt1717

Description

@JohnGalt1717

Is there a way to get more than this:

BeforeTest hook failed
at TUnit.Engine.Services.HookExecutor.ExecuteBeforeTestHooksAsync(AbstractExecutableTest test, CancellationToken cancellationToken)
at TUnit.Engine.TestExecutor.ExecuteAsync(AbstractExecutableTest executableTest, CancellationToken cancellationToken)
at TUnit.Engine.TestExecutor.ExecuteAsync(AbstractExecutableTest executableTest, CancellationToken cancellationToken)
at TUnit.Engine.TestExecutor.ExecuteAsync(AbstractExecutableTest executableTest, CancellationToken cancellationToken)
at TUnit.Engine.Services.TestExecution.TestCoordinator.<>c__DisplayClass10_0.<<ExecuteTestInternalAsync>b__0>d.MoveNext()
at TUnit.Engine.Services.TestExecution.TestCoordinator.<>c__DisplayClass10_0.<<ExecuteTestInternalAsync>b__0>d.MoveNext()
at TUnit.Engine.Services.TestExecution.RetryHelper.ExecuteWithRetry(TestContext testContext, Func`1 action)
at TUnit.Engine.Services.TestExecution.RetryHelper.ExecuteWithRetry(TestContext testContext, Func`1 action)
at TUnit.Engine.Services.TestExecution.TestCoordinator.ExecuteTestInternalAsync(AbstractExecutableTest test, CancellationToken cancellationToken)

Obviously just calling the method at the start of every test works in this case but [Before(class)] has the same issue and that's less straight forward.

It would be nice if the errors actually directly reported like they do in the tests themselves.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions