-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[Blazor] Fix template tests #54606
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
[Blazor] Fix template tests #54606
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
5085388
to
af4c2dd
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
b0ab194
to
70ea4d6
Compare
7c14145
to
408c832
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@@ -44,7 +44,6 @@ | |||
<Message Text="Building NPM packages..." Importance="high" /> | |||
|
|||
<Exec | |||
Condition="$(ContinuousIntegrationBuild) == 'true'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was required in order to build locally with the -pack
option. But unfortunately it seems to increase the build time quite a bit. Might be worth considering somehow moving this step to the "Pack"
target.
src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorWebTemplateTest.cs
Show resolved
Hide resolved
src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorWebTemplateTest.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file make it so that we use an alternate .NET host when running template projects. We copy select contents of the .dotnet
folder and then overlay the just-built shared framework on top of it. We also add an AssemblyAttribute
that can get picked up by the DotNetMuxer
so it knows to use the alternate host to run the template projects.
I decided to put this logic in PrepareForTest.targets
because this requirement is pretty specific to testing project templates, but I'm happy to consider putting it somewhere else if there's a compelling reason to do so.
src/ProjectTemplates/test/Templates.Blazor.Tests/Templates.Blazor.Tests.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good.
It would be great if we can document how the tests are expected to work and what setup is needed as well as the workflow for developers to run things locally.
Specifically all the changes to Directory.Build.targets.in, and similar files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, as we've discussed the remaining things offline, giving you the sign-off now and letting you address those as you see fit.
ae01e4e
to
bb41807
Compare
These shouldn't have an impact for now since we're only running in Helix.
Opening initially as a draft to resolve CI issues