Skip to content

Commit 94593dc

Browse files
committed
correct mscodecoverage not collected when RunInParallel
1 parent 2278ffe commit 94593dc

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

FineCodeCoverageTests/TestContainerDiscovery_Tests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,21 @@ public void Should_Not_ReloadCoverage_When_TestExecutionFinished_And_Reloading_W
141141
AssertShouldNotReloadCoverage();
142142
}
143143

144+
[Test]
145+
public void Should_ReloadCoverage_When_TestExecutionFinished_If_RunInParallel_But_MsCodeCoverage()
146+
{
147+
var (operation,_,__) = SetUpForProceedPath();
148+
SetUpOptions(mockAppOptions =>
149+
{
150+
mockAppOptions.Setup(o => o.Enabled).Returns(true);
151+
mockAppOptions.Setup(o => o.RunInParallel).Returns(true);
152+
mockAppOptions.Setup(o => o.MsCodeCoverage).Returns(true);
153+
});
154+
RaiseTestExecutionFinished(operation);
155+
156+
mocker.Verify<IFCCEngine>(engine => engine.ReloadCoverage(It.IsAny<Func<Task<List<ICoverageProject>>>>()));
157+
}
158+
144159
[Test]
145160
public async Task Should_ReloadCoverage_When_TestExecutionStarting_And_Settings_RunInParallel_Is_True()
146161
{

SharedProject/Impl/TestContainerDiscovery/TestContainerDiscoverer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private void CombinedLog(string message)
117117
private void TestExecutionFinished(IOperation operation)
118118
{
119119
var settings = appOptionsProvider.Get();
120-
if (!settings.Enabled || settings.RunInParallel)
120+
if (!settings.Enabled || (settings.RunInParallel && !settings.MsCodeCoverage))
121121
{
122122
return;
123123
}

0 commit comments

Comments
 (0)