Skip to content

Commit

Permalink
[xharness] Unset a few environment variables when running .NET tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Mar 12, 2020
1 parent f56fe80 commit 5dda97a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/xharness/Jenkins/TestTasks/DotNetBuildTask.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
using System.Collections.Generic;
using System.Diagnostics;

namespace Xharness.Jenkins.TestTasks {
class DotNetBuildTask : MSBuildTask {

public DotNetBuildTask ()
{
SetDotNetEnvironmentVariables (Environment);
}

protected override string ToolName {
get { return Harness.DOTNET; }
}
Expand All @@ -15,5 +22,15 @@ protected override List<string> ToolArguments {
return args;
}
}


public static void SetDotNetEnvironmentVariables (Dictionary<string, string> environment)
{
environment ["MSBUILD_EXE_PATH"] = null;
environment ["MSBuildExtensionsPathFallbackPathsOverride"] = null;
environment ["MSBuildSDKsPath"] = null;
environment ["TargetFrameworkFallbackSearchPaths"] = null;
environment ["MSBuildExtensionsPathFallbackPathsOverride"] = null;
}
}
}
1 change: 1 addition & 0 deletions tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class DotNetTestTask : RunTestTask {
public DotNetTestTask (DotNetBuildTask build_task)
: base (build_task)
{
DotNetBuildTask.SetDotNetEnvironmentVariables (Environment);
}

protected override async Task RunTestAsync ()
Expand Down

0 comments on commit 5dda97a

Please sign in to comment.