Skip to content

[Helix] Shared framework support + Templates tests #19177

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

Merged
merged 44 commits into from
Feb 26, 2020
Merged

Conversation

HaoK
Copy link
Member

@HaoK HaoK commented Feb 20, 2020

Rebased version of #16828

@Pilchie Pilchie added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Feb 20, 2020
@jkotalik
Copy link
Contributor

@HaoK do you still need me to look at why IIS tests are failing here now?

@HaoK
Copy link
Member Author

HaoK commented Feb 20, 2020

Yeah, I'm close to having an initial set of the templates tests working ( the easy ones), but we'll need to figure out why the IIS tests are failing before this PR can be merged. The templates tests are failing on the regular runs too right now, so something in the build might be messed up

@HaoK HaoK force-pushed the haok/helix-sfx2 branch 2 times, most recently from 47cef0c to c3aeed1 Compare February 21, 2020 21:04
@HaoK
Copy link
Member Author

HaoK commented Feb 22, 2020

Getting closer, looks like a few template tests are failing on mac and win7 and not everywhere else, mac failure looks to be cert related? @Tratcher can you help route these?

Full mac helix log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-aspnetcore-refs-pull-19177-merge-a10cb06b57c145b58a/ProjectTemplates.Tests--netcoreapp5.0/console.43e17a96.log?sv=2019-02-02&se=2020-03-03T11%3A48%3A00Z&sr=c&sp=rl&sig=OscPpILIMxefxFtC8fpRLw1BaBPp3d7TKq%2BP9VNHCYQ%3D

 Waiting until ASP.NET application is accepting connections...
 \x1b[40m\x1b[37mdbug\x1b[39m\x1b[22m\x1b[49m: Microsoft.Extensions.Hosting.Internal.Host[1]
       Hosting starting
 \x1b[40m\x1b[37mdbug\x1b[39m\x1b[22m\x1b[49m: Grpc.AspNetCore.Server.Model.Internal.ServiceRouteBuilder[2]
       Discovering gRPC methods for AspNet.grpc.oijlux20ggo.GreeterService.
 \x1b[40m\x1b[37mdbug\x1b[39m\x1b[22m\x1b[49m: Grpc.AspNetCore.Server.Model.Internal.ServiceRouteBuilder[1]
       Added gRPC method 'SayHello' to service 'greet.Greeter'. Method type: 'Unary', route pattern: '/greet.Greeter/SayHello'.
 \x1b[40m\x1b[37mdbug\x1b[39m\x1b[22m\x1b[49m: Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer[2]
       Failed to locate the development https certificate at '(null)'.
 \x1b[40m\x1b[37mdbug\x1b[39m\x1b[22m\x1b[49m: Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer[1]
       Unable to locate an appropriate development https certificate.
 \x1b[41m\x1b[1m\x1b[37mcrit\x1b[39m\x1b[22m\x1b[49m: Microsoft.AspNetCore.Server.Kestrel[0]
       Unable to start Kestrel.
 System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.
 To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.
 For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
    at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action`1 configureOptions)
    at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions)
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
 [ERROR] Unhandled exception. System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.
 [ERROR] To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.
 [ERROR] For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
 [ERROR]    at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action`1 configureOptions)
 [ERROR]    at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions)
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
 [ERROR]    at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
 [ERROR]    at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
 [ERROR]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
 [ERROR]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
 [ERROR]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
 [ERROR]    at AspNet.grpc.oijlux20ggo.Program.Main(String[] args) in /private/tmp/helix/working/AD850971/w/A902090F/e/Templates/BaseFolder/AspNet.grpc.oijlux20ggo/Program.cs:line 15

Grpc failure on Win7 looks like its just not supported? Does that template test need to be conditioned on something?

 System.NotSupportedException: HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.
    at Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware..ctor(ConnectionDelegate next, HttpsConnectionAdapterOptions options, ILoggerFactory loggerFactory)
    at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.<>c__DisplayClass12_0.<UseHttps>b__0(ConnectionDelegate next)
    at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.Build()
    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.<>c__DisplayClass21_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
 --- End of stack trace from previous location ---
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
    at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context)
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
 [ERROR] Unhandled exception. System.NotSupportedException: HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware..ctor(ConnectionDelegate next, HttpsConnectionAdapterOptions options, ILoggerFactory loggerFactory)
 [ERROR]    at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.<>c__DisplayClass12_0.<UseHttps>b__0(ConnectionDelegate next)
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.Build()
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.<>c__DisplayClass21_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
 [ERROR] --- End of stack trace from previous location ---
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context)
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
 [ERROR]    at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
 [ERROR]    at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
 [ERROR]    at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
 [ERROR]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
 [ERROR]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
 [ERROR]    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
 [ERROR]    at AspNet.grpc._4wm2a5ilva3.Program.Main(String[] args) in C:\h\w\A4FE0892\w\ACEB0953\e\Templates\BaseFolder\AspNet.grpc.4wm2a5ilva3\Program.cs:line 15


@Tratcher
Copy link
Member

@HaoK gRPC isn't supported on MAC or Win7. They already have built in skips:

// These templates are HTTPS + HTTP/2 only which is not supported on Mac due to missing ALPN support.
// https://github.com/dotnet/aspnetcore/issues/11061
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Assert.True(serverProcess.Process.HasExited, "built");
Assert.Contains("System.NotSupportedException: HTTP/2 over TLS is not supported on macOS due to missing ALPN support.",
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built service", Project, serverProcess.Process));
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.OSVersion.Version < new Version(6, 2))
{
Assert.True(serverProcess.Process.HasExited, "built");
Assert.Contains("System.NotSupportedException: HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.",
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built service", Project, serverProcess.Process));
}

The Win7 error matches the expected failure in the test, not sure why it didn't handle it.

The MacOS failure is interesting, it's missing the dev cert. It's not clear from the test code how it's supposed to provision the dev cert.

@JunTaoLuo @JamesNK @javiercn

@HaoK
Copy link
Member Author

HaoK commented Feb 22, 2020

Guess those RuntimeInfo checks aren't working well on helix, I'll just slap on SkipOnHelix queues for the specific queues for the grpc tests

@JamesNK
Copy link
Member

JamesNK commented Feb 22, 2020

I don't know if it is related but we've recently changed the gRPC template's launchSettings.json to include an HTTP endpoint to help macOS devs.

#19252

@JamesNK
Copy link
Member

JamesNK commented Feb 22, 2020

Hmm, I wonder why running the template test on macOS passed after that update.

I thought it only gave the error "HTTP/2 over TLS is not supported on macOS due to missing ALPN support." if HTTPS was the only endpoint.

@HaoK
Copy link
Member Author

HaoK commented Feb 24, 2020

Ok looks like we have a stable initial set of template tests working, there are still a bunch disabled, so I kept the azdo job running the template tests as well until they are full switched over. This is an initial checkpoint that I'd like to get merged though, since it brings over the shared framework, and runs most of the simple template tests. The ones that use identity and razor compilation are still failing due to restore issues (EF/compilation dll). I'll file issues to track re enabling the rest of those tests. But might as well start getting this reviewed

@HaoK HaoK marked this pull request as ready for review February 24, 2020 16:08
@HaoK HaoK requested a review from a team February 24, 2020 16:08
? GetAssemblyMetadata("ArtifactsLogDir")
: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "logs");

// FIGURE OUT EF PATH
Copy link
Contributor

Choose a reason for hiding this comment

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

File an issue tracking this

Copy link
Member Author

Choose a reason for hiding this comment

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

#19327 is the meta issue tracking all of the various skipped/remaining work

@@ -655,15 +657,19 @@ stages:

- template: jobs/default-build.yml
parameters:
condition: ne(variables['Build.Reason'], 'PullRequest')
# condition: ne(variables['Build.Reason'], 'PullRequest') UNCOMMENT after testing
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this bit ready to review?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the only way to test the daily/arm queues is by commenting out the conditions, I'll undo them once everything is ready to go

@HaoK
Copy link
Member Author

HaoK commented Feb 26, 2020

@dougbu are you good with merging this once everything is green, I will undo the daily and arm conditions as well before merging

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

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

Yes, this looks fine modulo the two things you said you'd undo before merging

@HaoK HaoK merged commit 4498058 into master Feb 26, 2020
@HaoK HaoK deleted the haok/helix-sfx2 branch February 26, 2020 20:55
@HaoK
Copy link
Member Author

HaoK commented Feb 26, 2020

Cool merged this initial checkpoint, I'll open a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants