dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.37k stars 350 forks source link

[Disabled test] [9.0] Aspire.Dashboard.Components.Tests.Controls.ApplicationNameTests.Render_DashboardClientDisabled_Success​ #2576

Open joperezr opened 4 months ago

joperezr commented 4 months ago

When merging a new test to the 9.0 branch, we started hitting a type load exception when trying to run the test. Here is the error message:

 Aspire.Dashboard.Components.Tests.Controls.ApplicationNameTests.Render_DashboardClientDisabled_Success​1ms
Error:
System.TypeLoadException : Could not load type 'Microsoft.JSInterop.IJSUnmarshalledRuntime' from assembly 'Microsoft.JSInterop, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

Stack trace:
   at Bunit.BunitJSInterop..ctor()
   at Bunit.TestContext..ctor() in /_/src/bunit.web/TestContext.cs:line 14
   at Aspire.Dashboard.Components.Tests.Controls.ApplicationNameTests..ctor()
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)

The issue is that the test class uses BUnit TestContext, which relies on type IJSUnmurshalledRuntime which was removed from 9.0 in PR https://github.com/dotnet/aspnetcore/pull/52732. This issue is to track the work to re-enable the test in 9.0 branch, whether it is by not using BUnit TestContext, or by having BUnit not depend on that type any longer.

cc: @JamesNK @egil

JamesNK commented 4 months ago

Created an issue in bunit repo - https://github.com/bUnit-dev/bUnit/issues/1402

egil commented 4 months ago

This has been fixed in latest release of bUnit. Thanks for bringing this to our attention.

JamesNK commented 4 months ago

Updating bUnit here: https://github.com/dotnet/aspire/pull/2693

@joperezr I think the remaining work would be to merge change into 9.0 branch and unskip the tests. Assigning to you.