diff --git a/src/mono/wasm/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs b/src/mono/wasm/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs index a3f250b462394c..39f7dfba8587ff 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs @@ -241,6 +241,7 @@ public void BugRegression_60479_WithRazorClassLib() Directory.CreateDirectory(wasmProjectDir); new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) .WithWorkingDirectory(wasmProjectDir) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) .ExecuteWithCapturedOutput("new blazorwasm") .EnsureSuccessful(); @@ -249,6 +250,7 @@ public void BugRegression_60479_WithRazorClassLib() Directory.CreateDirectory(razorProjectDir); new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false) .WithWorkingDirectory(razorProjectDir) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) .ExecuteWithCapturedOutput("new razorclasslib") .EnsureSuccessful(); diff --git a/src/mono/wasm/Wasm.Build.Tests/BlazorWasmTests.cs b/src/mono/wasm/Wasm.Build.Tests/BlazorWasmTests.cs index cfb725bd59f22a..91cf6c23156fe0 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BlazorWasmTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BlazorWasmTests.cs @@ -61,6 +61,7 @@ private CommandResult PublishForRequiresWorkloadTest(string config, string extra string publishLogPath = Path.Combine(s_buildEnv.LogRootPath, id, $"{id}.binlog"); return new DotNetCommand(s_buildEnv, _testOutput) .WithWorkingDirectory(_projectDir!) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) .ExecuteWithCapturedOutput("publish", $"-bl:{publishLogPath}", $"-p:Configuration={config}"); @@ -109,6 +110,7 @@ private void BuildNet50Project(string config, bool aot, bool expectError, string string publishLogPath = Path.Combine(logPath, $"{id}.binlog"); CommandResult result = new DotNetCommand(s_buildEnv, _testOutput) .WithWorkingDirectory(_projectDir!) + .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) .ExecuteWithCapturedOutput("publish", $"-bl:{publishLogPath}", (aot ? "-p:RunAOTCompilation=true" : ""), diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index f4a73bdbb0fe5b..d427f1d1f348d9 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -36,6 +36,7 @@ public abstract class BuildTestBase : IClassFixture ExecuteAsync(params string[] args) { var resolvedCommand = _command; string fullArgs = GetFullArgs(args); - _testOutput.WriteLine($"[{_label}] Executing - {resolvedCommand} {fullArgs} - {WorkingDirectoryInfo()}"); + _testOutput.WriteLine($"[{_label}] Executing - {resolvedCommand} {fullArgs} {WorkingDirectoryInfo()}"); return await ExecuteAsyncInternal(resolvedCommand, fullArgs); }