reqnroll / Reqnroll

Open-source Cucumber-style BDD test automation framework for .NET.
https://reqnroll.net
BSD 3-Clause "New" or "Revised" License
302 stars 33 forks source link

Capture ExecutionContext after every binding invoke #126

Closed obligaron closed 1 month ago

obligaron commented 1 month ago

Fixes #120

Reqnroll (and Specflow v4,x) uses Async internally (only one code path). To ensure the user sees no difference between the old (synchronous) implementation and the new ones the ExecutionContext (including AsyncLocal) are handled manually by Reqnroll. This is done using ExecutionContext.Capture() in BindingDelegateInvoker,InvokeInExecutionContext.

The problem is that this only works once. Background:

Bufix: Capture ExecutionContext explicitly in ExecutionContext.Run after every binding invoke.

Types of changes

Checklist:

gasparnagy commented 1 month ago

@obligaron you should be now on the @reqnroll/core-team (you need to accept invitation), so pushing new branches to the main repo should work now. (I hope. Please report if not.)