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

Enable AOT template tests #47247

Merged
merged 21 commits into from
Apr 28, 2023
Merged

Enable AOT template tests #47247

merged 21 commits into from
Apr 28, 2023

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Mar 16, 2023

Should work now that the api and grpc templates can be published without warnings.

@JamesNK JamesNK added the area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Mar 16, 2023
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Mar 16, 2023
@eerhardt eerhardt requested review from a team and wtgodbe as code owners March 16, 2023 16:03
@mitchdenny
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@eerhardt
Copy link
Member

Windows is failing with:

error : Platform linker not found. To fix this problem, download and install Visual Studio 2022 from http://visualstudio.com. Make sure to install the Desktop Development for C++ workload. For ARM64 development also install C++ ARM64 build tools. [C:hwA4770944wA7930936eTemplatesBaseFolderAspNet.oki3kcjzakbsAspNet.oki3kcjzakbs.csproj]

We would either need C++ on Helix, or need to run these tests on the build machines.

Linux and OSX are failing with:

NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'linux-x64'. 
NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'osx-x64'. 

We need to make sure the local runtime packs are being built, and are being used in the tests.

@JamesNK
Copy link
Member Author

JamesNK commented Mar 21, 2023

I don't have the time or build expertise to look at this. I think it should be done to avoid future regressions, but someone else will have to pick it up.

@mitchdenny
Copy link
Member

I did ask about how we get the Helix images updated with these dependencies in the First Responders ... which apparently was the wrong place ;) I don't know how we update these images either.

@wtgodbe
Copy link
Member

wtgodbe commented Mar 21, 2023

For the linux/osx tests that fail without the rid-specific SharedFx, that's because we build everything for Helix on windows, then send the bits off to various Helix queues (win, mac, linux), along with the dependencies they need (usually just .dll's). I guess these tests are doing something different and need the live-built SharedFx. A similar problem is tracked by #46620.

My inclination is that, if these tests depend on a SharedFx built on non-windows, then they're not suitable for helix and should be run on the build machines. All you need to do to achieve that is add a [SkipOnHelix("Link to a github issue")]

@eerhardt
Copy link
Member

There appear to be 2 issues:

  1. On Windows, we need to use a different Helix image.
    <HelixAvailableTargetQueue Include="Windows.Amd64.Server2022.Open" Platform="Windows" />

    We need to be using windows.amd64.vs2022.pre.open or something with "VS" in it.
  2. On Non-Windows, we are not getting the "targeting pack" that is being built for the non-Windows RID as @wtgodbe says above.

My inclination is that, if these tests depend on a SharedFx built on non-windows

These tests depend on the targeting pack. I'm not sure if your statement cares about the difference between that and the installed "SharedFx" or not.

and should be run on the build machines. All you need to do to achieve that is add a [SkipOnHelix("Link to a github issue")]

How does that make the tests run on the build machines? We need the tests to be run somewhere.

@eerhardt
Copy link
Member

One option here could be to only run the tests on Windows (on Helix) and rely on dotnet/runtime to work correctly on non-Windows, since ASP.NET doesn't have RID-specific code.

That would at least give us some test coverage, which is better than what we have today.

@wtgodbe
Copy link
Member

wtgodbe commented Mar 21, 2023

How does that make the tests run on the build machines? We need the tests to be run somewhere.

SkipOnHelix is poorly named, it really means "Run on a build agent instead of on Helix".

On Windows, we need to use a different Helix image.

The one you linked is one of the ones we only use in the helix-matrix job, which runs twice per day and mostly only gets looked at by build-ops. The one that runs in CI jobs is here:

<HelixAvailableTargetQueue Include="Windows.11.Amd64.Client.Open" Platform="Windows" />

If there's an available Win11 image that has the required VS components, we could switch to that, then add a [SkipOnHelix("{Issue Link}", Queues = "All.OSX;All.Ubuntu" + {Names of win queues that need to be skipped})], or something along those lines.

@mitchdenny mitchdenny force-pushed the jamesnk/aot-template-tests-unskip branch from 1a26e9a to c2b4c84 Compare March 29, 2023 02:45
@mitchdenny
Copy link
Member

@wtgodbe I'm trying to understand this better. If I put [SkipOnHelix] on a test case, does that mean it will run on an build agent. I've skipped some helix queues for the AOT tests in this PR and I can't see evidence that the tests ran at all.

@eerhardt
Copy link
Member

I've skipped some helix queues for the AOT tests in this PR and I can't see evidence that the tests ran at all.

An easy test is to explicitly make the test fail and push it. Then see if the test fails CI. If it doesn't, it must not be running.

@mitchdenny
Copy link
Member

Yep the tests aren't being run.

@DamianEdwards
Copy link
Member

I thought we didn't run the project templates tests on non-Helix builds at all?

@wtgodbe
Copy link
Member

wtgodbe commented Mar 30, 2023

@DamianEdwards what makes you say that?

In any case, I think there might be a bug in the SkipOnHelixAttribute. For example, BlazorServerTemplateWorks_IndividualAuth. This one only sets All.OSX as its queues to skip, and in CI it runs on Ubuntu/Windows in Helix, and Windows on a build agent. That seems very odd. As an experiment, could you try adding Queues = "All.Ubuntu" to the SkipOnHelix` attribute?

@halter73 or @BrennanConroy maybe you remember some of the original intention behind SkipOnHelixAttribute? My understanding was that tests that were skipped on helix would instead run on build agents, but it doesn't look like that's the behavior we're getting.

@BrennanConroy
Copy link
Member

My understanding was that tests that were skipped on helix would instead run on build agents, but it doesn't look like that's the behavior we're getting.

How would it do that? SkipOnHelixAttribute involves a runtime check. I think the way a test runs on Helix or not is determined by the build checking BuildHelixPayload. Which you can see is set to false for the blazor test
https://github.com/dotnet/aspnetcore/blob/83728cac8c2feb5b81f2402c3d83c32f9239c22c/src/ProjectTemplates/test/Templates.Blazor.Tests/Templates.Blazor.Tests.csproj#LL17C31-L17C49

Also, remember, Blazor is a crazy area and has the same named tests in different projects...
So one version of BlazorServerTemplateWorks_IndividualAuth runs on build agents, the other runs on Helix

@DamianEdwards
Copy link
Member

@wtgodbe probably ignorance 😄

When doing the big template tests overhaul last year (or was it the year before?) it was always the Helix matrix run that was an issue, and I thought I recalled it was because the vast majority of template tests/variations didn't run on the regular CI builds, only on Helix matrix. But I'm likely just misremembering.

@wtgodbe
Copy link
Member

wtgodbe commented Mar 30, 2023

Huh, I had thought SkipOnHelix was our way of getting an individual test case (rather than the whole test project) to run on a build agent, but it seems I may have been misinformed. Do we not have a way to do that today?

@BrennanConroy
Copy link
Member

way of getting an individual test case (rather than the whole test project) to run on a build agent

I've never heard of a feature like this, and it sounds like a pain to implement 😄

@eerhardt
Copy link
Member

What's the recommended approach to getting these tests to run in PR validation?

I would be happy with getting just 1 leg running, for example Windows. Can we have the template test run in a Helix machine with Visual Studio installed? (we will need Visual C++ too)

@wtgodbe
Copy link
Member

wtgodbe commented Mar 30, 2023

You could change

<HelixAvailableTargetQueue Include="Windows.Amd64.Server2022.Open" Platform="Windows" />
to be windows.amd64.vs2022.pre.open, then add Queues = "Windows.11.Amd64.Client.Open;" + All.OSX + All.Ubuntu to the SkipOnHelix attributes. This would get the Windows jobs running in the Helix Matrix pipeline twice daily, but not during CI (I think we can't switch to the vs2022 queue in CI jobs because of capacity, maybe someone from @dotnet/dnceng can confirm)

@dougbu
Copy link
Member

dougbu commented Mar 30, 2023

I think we can't switch to the vs2022 queue in CI jobs because of capacity

The Helix queues auto-balance relatively quickly. As long as it's really a switch, capacity shouldn't be a big deal after the initial ramp up.

@mitchdenny
Copy link
Member

Yeah we really want this running via CI for obvious reasons. It would be good if you could guide us through the process for using the vs2022.pre queues. I'm assuming its not the same change that @wtgodbe mentioned above.

@mitchdenny
Copy link
Member

... also is there a config file/doc somewhere that describes what is on each image?

@mitchdenny mitchdenny force-pushed the jamesnk/aot-template-tests-unskip branch from d46fd41 to 87c6f76 Compare April 20, 2023 06:10
@@ -21,6 +21,7 @@

namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests;

[SkipOnHelix("Unsupported queue", Queues = "Windows.Amd64.VS2022.Pre.Open;")]
Copy link
Member Author

Choose a reason for hiding this comment

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

Why don't these tests run on this queue? Is HTTP.sys and IIS not on the image?

It would be good to have a better description in the attribute.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are all the HTTP.sys and IIS functional tests skipped? If so, SkipOnHelix attribute might work on the assembly. Avoids modifying so many files.

Copy link
Member

Choose a reason for hiding this comment

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

Based on the usage attributes the SkipOnHelix attribute doesn't work at the assembly level. The reason I am disabling these tests is that they are causing failtures due to hitting some 40m threshold. I'm not certain if it's that IIS just won't work on that image or if it is something else at this stage.

@@ -35,7 +36,8 @@ public async Task ApiTemplateCSharp()
await ApiTemplateCore(languageOverride: null);
}

[ConditionalFact(Skip = "Unskip when Helix supports native AOT. https://github.com/dotnet/aspnetcore/pull/47247/")]
[ConditionalFact]
[SkipOnHelix("https://github.com/dotnet/aspnetcore/issues/47478", Queues = "OSX.13.Amd64.Open;Ubuntu.2004.Amd64.Open;Windows.11.Amd64.Client.Open;")]
Copy link
Member Author

Choose a reason for hiding this comment

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

This set of queues seems duplicated a bunch of times. Maybe have a const in this project and append const here and elsewhere? It makes updating it easier in the future.

@mitchdenny mitchdenny modified the milestones: 8.0-preview4, 8.0-preview5 Apr 26, 2023
@mitchdenny
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mitchdenny mitchdenny merged commit c6ccf23 into main Apr 28, 2023
@mitchdenny mitchdenny deleted the jamesnk/aot-template-tests-unskip branch April 28, 2023 08:41
@danmoseley danmoseley removed the area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants