Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable SB tests #46055

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Re-enable SB tests #46055

wants to merge 5 commits into from

Conversation

mthalman
Copy link
Member

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Jan 16, 2025
@mthalman
Copy link
Member Author

Current test failures:

DotNetWatchTests.WatchTests

Assert.True() Failure
Expected: True
Actual:   False
 at Microsoft.DotNet.SourceBuild.Tests.DotNetWatchTests.WatchTests() in /_/test/Microsoft.DotNet.SourceBuild.Tests/DotNetWatchTests.cs:line 35
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

WebScenarioTests.VerifyScenario

Runtime packs were retrieved from NuGet instead of the SDK
   at Microsoft.DotNet.SourceBuild.Tests.WebScenarioTests.VerifyRuntimePacksForSelfContained(String projectPath) in /_/test/Microsoft.DotNet.SourceBuild.Tests/WebScenarioTests.cs:line 55
   at Microsoft.DotNet.SourceBuild.Tests.TestScenario.Execute(DotNetHelper dotNetHelper) in /_/test/Microsoft.DotNet.SourceBuild.Tests/TestScenario.cs:line 75
   at Microsoft.DotNet.SourceBuild.Tests.WebScenarioTests.VerifyScenario(TestScenario scenario) in /_/test/Microsoft.DotNet.SourceBuild.Tests/WebScenarioTests.cs:line 25
   at InvokeStub_WebScenarioTests.VerifyScenario(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

DotNetFormatTests.FormatProject

System.InvalidOperationException : Failed to execute /__w/1/vmr/artifacts/obj/extracted-dotnet-sdk/dotnet format /__w/1/vmr/artifacts/bin/Microsoft.DotNet.SourceBuild.Tests/Release/projects-202501161845028438/FormatProject/FormatProject.csproj
Exit code: 1


Unhandled exception: Microsoft.CodeAnalysis.MSBuild.RemoteInvocationException: An exception of type System.IO.FileNotFoundException was thrown: Could not load file or assembly 'Microsoft.Build.Locator, Version=1.6.10.0, Culture=neutral, PublicKeyToken=9dff12846e04bfbd'. The system cannot find the file specified.


at Microsoft.CodeAnalysis.MSBuild.RpcClient.InvokeCoreAsync(Int32 targetObject, String methodName, List1 parameters, Type expectedReturnType, CancellationToken cancellationToken)    at Microsoft.CodeAnalysis.MSBuild.RpcClient.InvokeAsync[T](Int32 targetObject, String methodName, List1 parameters, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.MSBuild.RemoteBuildHost.LoadProjectFileAsync(String projectFilePath, String languageName, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.DoOperationAndReportProgressAsync[TResult](ProjectLoadOperation operation, String projectPath, String targetFramework, Func1 doFunc)    at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadProjectFileInfosAsync(String projectPath, DiagnosticReportingOptions reportingOptions, CancellationToken cancellationToken)    at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadProjectInfosFromPathAsync(String projectPath, DiagnosticReportingOptions reportingOptions, CancellationToken cancellationToken)    at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.Worker.LoadAsync(CancellationToken cancellationToken)    at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.LoadProjectInfoAsync(String projectFilePath, ProjectMap projectMap, IProgress1 progress, ILogger msbuildLogger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.MSBuild.MSBuildProjectLoader.LoadProjectInfoAsync(String projectFilePath, ProjectMap projectMap, IProgress1 progress, ILogger msbuildLogger, CancellationToken cancellationToken)    at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.OpenProjectAsync(String projectFilePath, ILogger msbuildLogger, IProgress1 progress, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Workspaces.MSBuildWorkspaceLoader.LoadAsync(String solutionOrProjectPath, WorkspaceType workspaceType, String binaryLogPath, Boolean logWorkspaceWarnings, ILogger logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.CodeFormatter.OpenMSBuildWorkspaceAsync(String solutionOrProjectPath, WorkspaceType workspaceType, Boolean noRestore, Boolean requiresSemantics, String binaryLogPath, Boolean logWorkspaceWarnings, ILogger logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.CodeFormatter.FormatWorkspaceAsync(FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken, String binaryLogPath)
at Microsoft.CodeAnalysis.Tools.FormatCommandCommon.FormatAsync(FormatOptions formatOptions, ILogger`1 logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Commands.RootFormatCommand.FormatCommandDefaultHandler.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)

SymbolsTests.VerifySdkSymbols

Assert.True() Failure
Expected: True
Actual:   False
   at Microsoft.DotNet.SourceBuild.Tests.SymbolsTests.VerifySdkSymbols() in /_/test/Microsoft.DotNet.SourceBuild.Tests/SymbolsTests.cs:line 57
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

@mthalman
Copy link
Member Author

@NikolaMilosavljevic - Could you help investigate why the symbols test is failing? It looks like all of the DLLs within the SDK are being reported as having no PDBs.

@NikolaMilosavljevic
Copy link
Member

@NikolaMilosavljevic - Could you help investigate why the symbols test is failing? It looks like all of the DLLs within the SDK are being reported as having no PDBs.

Pushed a fix for symbols tests - 196f148

@tmds
Copy link
Member

tmds commented Jan 17, 2025

  • DotNetWatchTests.WatchTests

const string waitingString = "Waiting for changes";

should be changed to:

const string waitingString = "Waiting for a file to change before restarting";
  • WebScenarioTests.VerifyScenario

VerifyRuntimePacksForSelfContained is detecting the Microsoft.AspNetCore.App.Internal.Assets package that was added in #44997. Probably this one can be ignored by VerifyRuntimePacksForSelfContained.

  • DotNetFormatTests.FormatProject

The BuildHost-netcore (that gets started by dotnet-format) is failing to load Microsoft.Build.Locator. From the .deps.json it looks like something is wrong when the project gets built. .NET 9 vs .NET 10 .deps.json:

@@ -1,22 +1,17 @@
 {
   "runtimeTarget": {
-    "name": ".NETCoreApp,Version=v9.0",
+    "name": ".NETCoreApp,Version=v10.0",
     "signature": ""
   },
   "compilationOptions": {},
   "targets": {
-    ".NETCoreApp,Version=v9.0": {
-      "Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost/4.12.0-3.24570.6": {
+    ".NETCoreApp,Version=v10.0": {
+      "Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost/4.14.0-1.25064.9": {
         "dependencies": {
-          "Microsoft.Build": "17.3.4",
           "Microsoft.Build.Framework": "17.3.4",
-          "Microsoft.Build.Locator": "1.6.10",
-          "Microsoft.Build.Tasks.Core": "17.3.4",
-          "Microsoft.Build.Utilities.Core": "17.3.4",
-          "Microsoft.DotNet.XliffTasks": "9.0.0-beta.24516.2",
           "Newtonsoft.Json": "13.0.3",
-          "System.Collections.Immutable": "9.0.0",
-          "System.CommandLine": "2.0.0-beta4.24326.1"
+          "System.Collections.Immutable": "10.0.0-alpha.1.25063.12",
+          "System.CommandLine": "2.0.0-beta4.24529.1"
         },
         "runtime": {
           "Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.dll": {}
@@ -63,61 +58,9 @@
           }
         }
       },

@mthalman
Copy link
Member Author

VerifyRuntimePacksForSelfContained is detecting the Microsoft.AspNetCore.App.Internal.Assets package that was added in #44997. Probably this one can be ignored by VerifyRuntimePacksForSelfContained.

@tmds - Can you explain why it's safe to ignore that one?

@tmds
Copy link
Member

tmds commented Jan 17, 2025

Can you explain why it's safe to ignore that one?

My limited understanding is that this functionality is different than the ASP.NET Core runtime, which is what the test is checking for. It would be good to understand what it is exactly and how this is going to be delivered eventually.

@mthalman
Copy link
Member Author

Can you explain why it's safe to ignore that one?

My limited understanding is that this functionality is different than the ASP.NET Core runtime, which is what the test is checking for. It would be good to understand what it is exactly and how this is going to be delivered eventually.

@MackinnonBuck - Can you provide some more context around the Microsoft.AspNetCore.App.Internal.Assets package and its inclusion with the SDK changes in #44997? We have a test that is failing due to this assembly. The test runs a self-contained publish of a web project. The intent of the test is to verify that no packages get restored from a NuGet feed and instead are available directly from the SDK. But that doesn't happen with the Microsoft.AspNetCore.App.Internal.Assets package.

@MackinnonBuck
Copy link
Member

That package contains JavaScript files that get served as part of each Blazor app to provide core framework functionality. Prior to the introduction of this package, these files were embedded resources in framework DLLs, but this meant they couldn't participate in the app's build process the same way as other assets defined by the app (build time compression and fingerprinting, etc.).

Furthermore, NodeJS is required to build these files, but we didn't want NodeJS to be a dependency of source build. Our initial solution to this was to check in the built JS assets, but this created a number of issues, including security concerns.

So, we recently introduced this package to implicitly bring those files into the customer's project, and it's excluded from source build due to its NodeJS dependency.

cc @javiercn, in case there's more context on the source-build problem you think should be shared.

@tmds
Copy link
Member

tmds commented Jan 17, 2025

Will this package be shipped with the SDK, or will it be provided through nuget.org? Is this the same mechanism for the source-built and the Microsoft-built SDKs?

@MackinnonBuck
Copy link
Member

I believe this package was just going to be provided on nuget.org. The intention was to make this package work in a similar way to Microsoft.NET.Sdk.WebAssembly.Pack. But looking at my local dotnet SDK installation, I see that Microsoft.NET.Sdk.WebAssembly.Pack is included in the library-packs folder, whereas Microsoft.AspNetCore.App.Internal.Assets is not. Do we need to somehow include Microsoft.AspNetCore.App.Internal.Assets in the SDK as well? TBH this is an area I'm not very familiar with.

@MackinnonBuck
Copy link
Member

@maraf, do you know how Microsoft.NET.Sdk.WebAssembly.Pack ships? It gets included in the SDK somehow, right? Do you know how we can make this happen with Microsoft.AspNetCore.App.Internal.Assets, which was added in #44997?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reenable PublishSelfContained scenario test
4 participants