Skip to content

Commit 5dcce55

Browse files
committed
Fix Wasm.Build.Tests failures
- Use latest sdk for testing - Add dotnet8 feed, needed by blazorwasm templates - Workaround a bug in 7.0 templates which will be fixed by #76373 . And this can be removed once we have packages with that.
1 parent cb9e7a6 commit 5dcce55

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
<GrpcDotnetClientVersion>2.45.0</GrpcDotnetClientVersion>
178178
<GrpcToolsVersion>2.45.0</GrpcToolsVersion>
179179
<!-- Uncomment to set a fixed version, else the latest is used -->
180-
<SdkVersionForWorkloadTesting>8.0.100-alpha.1.22463.23</SdkVersionForWorkloadTesting>
180+
<!--<SdkVersionForWorkloadTesting>8.0.100-alpha.1.22463.23</SdkVersionForWorkloadTesting>-->
181181
<CompilerPlatformTestingVersion>1.1.2-beta1.22403.2</CompilerPlatformTestingVersion>
182182
<!-- Docs -->
183183
<MicrosoftPrivateIntellisenseVersion>7.0.0-preview-20220920.1</MicrosoftPrivateIntellisenseVersion>

src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,19 @@ private void ConsoleBuildAndRun(string config, bool relinking, string extraNewAr
222222

223223
(int exitCode, string output) = RunProcess(s_buildEnv.DotNet, _testOutput, args: $"run --no-build -c {config} x y z", workingDir: _projectDir);
224224
Assert.Equal(42, exitCode);
225-
Assert.Contains("args[0] = x", output);
226-
Assert.Contains("args[1] = y", output);
227-
Assert.Contains("args[2] = z", output);
225+
if (extraNewArgs.Contains("-f net7.0"))
226+
{
227+
// Workaround for https://github.com/dotnet/runtime/issues/76201
228+
Assert.Contains("args[0] = dotnet", output);
229+
Assert.Contains("args[1] = is", output);
230+
Assert.Contains("args[2] = great!", output);
231+
}
232+
else
233+
{
234+
Assert.Contains("args[0] = x", output);
235+
Assert.Contains("args[1] = y", output);
236+
Assert.Contains("args[2] = z", output);
237+
}
228238
}
229239

230240
public static TheoryData<bool, bool, string> TestDataForAppBundleDir()

src/mono/wasm/Wasm.Build.Tests/data/nuget7.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<packageSources>
99
<clear />
1010
<!-- TEST_RESTORE_SOURCES_INSERTION_LINE -->
11+
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
1112
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
1213
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
1314
</packageSources>

0 commit comments

Comments
 (0)