Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public bool Deploy(IEnumerable<TestCase> testCases, IRunContext? runContext, IFr
return false;
}

#if NETFRAMEWORK
string? firstTestSource = testCases.FirstOrDefault()?.Source;
RunDirectories = _deploymentUtility.CreateDeploymentDirectories(runContext, firstTestSource);

Expand All @@ -136,6 +137,16 @@ public bool Deploy(IEnumerable<TestCase> testCases, IRunContext? runContext, IFr
{
return false;
}
#else
// On .NET Core, avoid creating empty deployment folders when no deployment items are used.
if (!hasDeploymentItems)
{
return false;
}

string? firstTestSource = testCases.FirstOrDefault()?.Source;
RunDirectories = _deploymentUtility.CreateDeploymentDirectories(runContext, firstTestSource);
#endif

// Object model currently does not have support for SuspendCodeCoverage. We can remove this once support is added
#if NETFRAMEWORK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,12 @@ public void DeployShouldReturnFalseWhenDeploymentEnabledSetToFalseAndHasNoDeploy
// Deployment should not happen
testDeployment.Deploy(new List<TestCase> { testCase }, null, null!).Should().BeFalse();

// Deployment directories should get created
// Deployment directories should get created on .NET Framework for compat, but not on .NET Core
#if NETFRAMEWORK
testDeployment.GetDeploymentDirectory().Should().NotBeNull();
#else
testDeployment.GetDeploymentDirectory().Should().BeNull();
#endif
}

public void DeployShouldReturnFalseWhenDeploymentEnabledSetToTrueButHasNoDeploymentItems()
Expand All @@ -242,8 +246,12 @@ public void DeployShouldReturnFalseWhenDeploymentEnabledSetToTrueButHasNoDeploym
// Deployment should not happen
testDeployment.Deploy(new List<TestCase> { testCase }, null, null!).Should().BeFalse();

// Deployment directories should get created
// Deployment directories should get created on .NET Framework for compat, but not on .NET Core
#if NETFRAMEWORK
testDeployment.GetDeploymentDirectory().Should().NotBeNull();
#else
testDeployment.GetDeploymentDirectory().Should().BeNull();
#endif
}

// TODO: This test has to have mocks. It actually deploys stuff and we cannot assume that all the dependencies get copied over to bin\debug.
Expand Down