Skip to content

Commit

Permalink
Dispose TestThread-Container correctly (#135)
Browse files Browse the repository at this point in the history
* Dispose TestThread-Container correctly

* use _testRunnerRegistry directly to access test thread containers, add unit test

* undo system tests

* cleanup TestRunnerManagerTests

* cleanup TestRunnerManager

---------

Co-authored-by: Gáspár Nagy <gaspar.nagy@gmail.com>
  • Loading branch information
obligaron and gasparnagy authored May 22, 2024
1 parent 5257abd commit 3ae913a
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 270 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Fix: StackOverflowException when using `[StepArgumentTransformation]` with same input and output type, for example string (#71)
* Fix: Autofac without hook does not run GlobalDependencies (#127)
* Fix: Reqnroll.Autofac shows wrongly ambiguous step definition (#56)
* Fix: Dispose objects registred in test thread container at the end of test execution (#123)

# v1.0.1 - 2024-02-16

Expand Down
1 change: 1 addition & 0 deletions Reqnroll/ITestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public interface ITestRunner
string TestWorkerId { get; }
FeatureContext FeatureContext { get; }
ScenarioContext ScenarioContext { get; }
ITestThreadContext TestThreadContext { get; }

void InitializeTestRunner(string testWorkerId);

Expand Down
1 change: 1 addition & 0 deletions Reqnroll/Infrastructure/ITestExecutionEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public interface ITestExecutionEngine
{
FeatureContext FeatureContext { get; }
ScenarioContext ScenarioContext { get; }
ITestThreadContext TestThreadContext { get; }

Task OnTestRunStartAsync();
Task OnTestRunEndAsync();
Expand Down
12 changes: 4 additions & 8 deletions Reqnroll/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ public TestRunner(ITestExecutionEngine executionEngine)
_executionEngine = executionEngine;
}

public FeatureContext FeatureContext
{
get { return _executionEngine.FeatureContext; }
}
public FeatureContext FeatureContext => _executionEngine.FeatureContext;

public ScenarioContext ScenarioContext
{
get { return _executionEngine.ScenarioContext; }
}
public ScenarioContext ScenarioContext => _executionEngine.ScenarioContext;

public ITestThreadContext TestThreadContext => _executionEngine.TestThreadContext;

public async Task OnTestRunStartAsync()
{
Expand Down
Loading

0 comments on commit 3ae913a

Please sign in to comment.