Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@
<MicrosoftExtensionsLoggingVersion>3.1.7</MicrosoftExtensionsLoggingVersion>
<MicrosoftSymbolStoreVersion>1.0.406601</MicrosoftSymbolStoreVersion>
<!-- sdk version, for testing workloads -->
<SdkVersionForWorkloadTesting>$(MicrosoftDotNetApiCompatTaskVersion)</SdkVersionForWorkloadTesting>
<!--<SdkVersionForWorkloadTesting>9.0.102</SdkVersionForWorkloadTesting>-->
<!-- <SdkVersionForWorkloadTesting>$(MicrosoftDotNetApiCompatTaskVersion)</SdkVersionForWorkloadTesting> -->
<SdkVersionForWorkloadTesting>9.0.105</SdkVersionForWorkloadTesting>
Comment on lines +265 to +266
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akoeplinger Should I merge this in to avoid non-existent 9.0.106 or do we handle it separately?

Copy link
Member

@akoeplinger akoeplinger Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we're doing it as part of #114700 too. not sure when that PR will go in.

<runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion>9.0.0-alpha.1.24175.1</runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion>
<EmsdkPackageVersion>$(MicrosoftNETRuntimeEmscriptenVersion)</EmsdkPackageVersion>
<NodePackageVersion>$(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion)</NodePackageVersion>
Expand Down
40 changes: 40 additions & 0 deletions src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;
using Microsoft.Build.Logging.StructuredLogger;

#nullable enable

Expand Down Expand Up @@ -176,9 +177,48 @@ public BuildTestBase(ProjectProviderBase providerBase, ITestOutputHelper output,
else if (res.ExitCode == 0)
throw new XunitException($"Build should have failed, but it didn't. Process exited with exitCode : {res.ExitCode}");

// Ensure we got all output.
string[] successMessages = ["Build succeeded"];
string[] errorMessages = ["Build failed", "Build FAILED", "Restore failed", "Stopping the build"];
if ((res.ExitCode == 0 && successMessages.All(m => !res.Output.Contains(m))) || (res.ExitCode != 0 && errorMessages.All(m => !res.Output.Contains(m))))
{
_testOutput.WriteLine("Replacing dotnet process output with messages from binlog");

var outputBuilder = new StringBuilder();
var buildRoot = BinaryLog.ReadBuild(logFilePath);
buildRoot.VisitAllChildren<TextNode>(m =>
{
if (m is Message || m is Error || m is Warning)
{
var context = GetBinlogMessageContext(m);
outputBuilder.AppendLine($"{context}{m.Title}");
}
});

res = new CommandResult(res.StartInfo, res.ExitCode, outputBuilder.ToString());
}

return (res, logFilePath);
}

private string GetBinlogMessageContext(TextNode node)
{
var currentNode = node;
while (currentNode != null)
{
if (currentNode is Error error)
{
return $"{error.File}({error.LineNumber},{error.ColumnNumber}): error {error.Code}: ";
}
else if (currentNode is Warning warning)
{
return $"{warning.File}({warning.LineNumber},{warning.ColumnNumber}): warning {warning.Code}: ";
}
currentNode = currentNode.Parent as TextNode;
}
return string.Empty;
}

protected string RunAndTestWasmApp(BuildArgs buildArgs,
RunHost host,
string id,
Expand Down
1 change: 1 addition & 0 deletions src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Playwright" Version="1.21.0" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.2.350" />
<ProjectReference Include="$(RepoRoot)src\tasks\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj" />
<!-- Update the version provided by Microsoft.Playwright but drop it in favor of framework copy-->
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" PrivateAssets="All" ExcludeAssets="All" />
Expand Down
Loading