Skip to content

Commit

Permalink
Avoid logging >Task returned false but did not log an error.< on test…
Browse files Browse the repository at this point in the history
… failure
  • Loading branch information
nohwnd committed Oct 2, 2020
1 parent 1d30394 commit 4f345e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ public override bool Execute()
var traceEnabledValue = Environment.GetEnvironmentVariable("VSTEST_BUILD_TRACE");
Tracing.traceEnabled = !string.IsNullOrEmpty(traceEnabledValue) && traceEnabledValue.Equals("1", StringComparison.OrdinalIgnoreCase);

// Avoid logging "Task returned false but did not log an error." on test failure, because we don't
// write MSBuild error. https://github.com/dotnet/msbuild/blob/51a1071f8871e0c93afbaf1b2ac2c9e59c7b6491/src/Framework/IBuildEngine7.cs#L12
BuildEngine.GetType().GetProperty("AllowFailureWithoutError")?.SetValue(BuildEngine, true);

vsTestForwardingApp = new VSTestForwardingApp(this.VSTestConsolePath, this.CreateArgument());
if (!string.IsNullOrEmpty(this.VSTestFramework))
{
Expand Down

0 comments on commit 4f345e9

Please sign in to comment.