Skip to content

Add usings back to Blazor client Program.cs #34259

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

Closed
wants to merge 1 commit into from

Conversation

DamianEdwards
Copy link
Member

@DamianEdwards DamianEdwards commented Jul 11, 2021

BlazorWasm SDK hasn't got implicit global usings as yet so they need to be included for now.

Successfully ran the BlazorWasm template and ProjectTemplates.Tests passed locally.

@captainsafia @davidfowl

BlazorWasm SDK hasn't got implicit global usings as yet so they need to be included for now.
@lewing
Copy link
Member

lewing commented Jul 11, 2021

So how did this all get broken in the way it did?

@davidfowl
Copy link
Member

So how did this all get broken in the way it did?

That's the real question. Turns out these tests are quarantined and they don't fail the build?

@DamianEdwards
Copy link
Member Author

@lewing what @davidfowl said. The template tests don't fail CI and this one file got missed.

@lewing
Copy link
Member

lewing commented Jul 11, 2021

one file? 👎

@DamianEdwards
Copy link
Member Author

And by "missed" I mean "included when it shouldn't have been" 😐

@lewing
Copy link
Member

lewing commented Jul 11, 2021

So how do we avoid this kind of oversight breaking things for days in the future?

@DamianEdwards
Copy link
Member Author

@lewing not sure what you're referring to in this case, my change went in yesterday evening. At any rate, something to take up with @dotnet/aspnet-build. I'd certainly appreciate any change that catches template issues at the stage they're in PR to this repo.

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Jul 11, 2021
@davidfowl
Copy link
Member

@HaoK and @dougbu have some opinions here.

cc @mkArtakMSFT @Pilchie as an FYI because I agree with @lewing this should fail the build. Apparently there's some history here with flaky template tests being disabled and the build passes as a result even when it fails.

@HaoK
Copy link
Member

HaoK commented Jul 11, 2021

I think we should probably add back the equivalent of the build/publish only versions of the blazor templates just like the other templates, and leave the playwright enabled version in quarantine that is doing more verification than the other templates, so at least blazor templates have parity with the other templates and we don't have this gaping hole. I can probably whip something together on monday in a PR

@HaoK
Copy link
Member

HaoK commented Jul 12, 2021

#34275 the blazor template tests are failing in the PR with missing using errors, just making sure that these are the failures we should be expecting to see in main right now?

 | [20.973s] Templates.Test.BlazorWasmTemplateTest Information: /datadisks/disk1/work/A4A108F8/w/B08209BB/e/Templates/BaseFolder/AspNet.4gejuehuxut/Program.cs(7,18): error CS1061: 'IServiceCollection' does not contain a definition for 'AddScoped' and no accessible extension method 'AddScoped' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) [/datadisks/disk1/work/A4A108F8/w/B08209BB/e/Templates/BaseFolder/AspNet.4gejuehuxut/AspNet.4gejuehuxut.csproj]
 | [20.973s] Templates.Test.BlazorWasmTemplateTest Information: /datadisks/disk1/work/A4A108F8/w/B08209BB/e/Templates/BaseFolder/AspNet.4gejuehuxut/Program.cs(9,18): error CS1061: 'IServiceCollection' does not contain a definition for 'AddMsalAuthentication' and no accessible extension method 'AddMsalAuthentication' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) [/datadisks/disk1/work/A4A108F8/w/B08209BB/e/Templates/BaseFolder/AspNet.4gejuehuxut/AspNet.4gejuehuxut.csproj]

@davidfowl
Copy link
Member

Yep!

@SteveSandersonMS
Copy link
Member

@davidfowl

Apparently there's some history here with flaky template tests being disabled and the build passes as a result even when it fails.

That's very much correct. It also applies to all the other browser automation tests that we have. Despite probably hundreds of hours of work trying to make them "reliable" in CI, we haven't got any closer over time. If anything, we've got further from the goal over time. I no longer believe it's a defect in the tests, but rather a mixture of (1) the infrastructure needing to be much less resource constrained because actual browsers don't perform with extreme resource shortages, and (2) us stopping thinking of UI automation as just another kind of unit test, as they just aren't.

@DamianEdwards
Copy link
Member Author

This PR is likely not needed anymore as @davidfowl's change to the SDK should negate the need for it.

@dougbu dougbu deleted the damianedwards/blazorwasmfix branch August 21, 2021 22:37
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.

6 participants