Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use global and local dotnet CLI properly
Since the test frameworks use copied and patched cli, mismatch can cause tests fail.

One of the failures caused when sometimes "NuGetFallbackFolder" becomes the first directory
to resolve "dotnet.dll" against. It is now fixed by excluding the fallback folder in the resolving logic.
  • Loading branch information
Nirmal4G committed Mar 28, 2021
commit 1b7e0ccf5f83474cbc3c7fa8d1b420749b9820bf
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ if (( $? )); then
exit 1
fi

# Disable .NET CLI Install Lookup
DOTNET_MULTILEVEL_LOOKUP=0

DOTNET="$(pwd)/cli/dotnet"

# Let the dotnet cli expand and decompress first if it's a first-run
Expand Down
3 changes: 3 additions & 0 deletions scripts/funcTests/runFuncTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ if (( $? )); then
exit 1
fi

# Disable .NET CLI Install Lookup
DOTNET_MULTILEVEL_LOOKUP=0

DOTNET="$(pwd)/cli/dotnet"

# Let the dotnet cli expand and decompress first if it's a first-run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public MsbuildIntegrationTestFixture()
var dotnetExecutableName = RuntimeEnvironmentHelper.IsWindows ? "dotnet.exe" : "dotnet";
TestDotnetCli = Path.Combine(_cliDirectory, dotnetExecutableName);

var sdkPath = Directory.EnumerateDirectories(Path.Combine(_cliDirectory, "sdk")).Single();
var sdkPath = Directory.EnumerateDirectories(Path.Combine(_cliDirectory, "sdk"))
.Where(d => !string.Equals(Path.GetFileName(d), "NuGetFallbackFolder", StringComparison.OrdinalIgnoreCase))
.Single();

MsBuildSdksPath = Path.Combine(sdkPath, "Sdks");

Expand Down Expand Up @@ -442,6 +444,7 @@ private void UpdateCliWithLatestNuGetAssemblies(string cliDirectory)
var artifactsDirectory = DotnetCliUtil.GetArtifactsDirectoryInRepo();
var pathToSdkInCli = Path.Combine(
Directory.EnumerateDirectories(Path.Combine(cliDirectory, "sdk"))
.Where(d => !string.Equals(Path.GetFileName(d), "NuGetFallbackFolder", StringComparison.OrdinalIgnoreCase))
.First());
const string configuration =
#if DEBUG
Expand Down