-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc84fad
commit 8f7ca14
Showing
7 changed files
with
58 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/Bicep.Local.Deploy.IntegrationTests/KestrelProviderExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using Bicep.Local.Extension; | ||
using Bicep.Local.Extension.Rpc; | ||
using Bicep.Local.Extension.Protocol; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.AspNetCore.Server.Kestrel.Core; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Bicep.Local.Deploy.IntegrationTests; | ||
|
||
[TestClass] | ||
public class KestrelProviderExtension : ProviderExtension | ||
{ | ||
protected override async Task RunServer(string socketPath, ResourceDispatcher dispatcher, CancellationToken cancellationToken) | ||
{ | ||
var builder = WebApplication.CreateBuilder(); | ||
builder.WebHost.ConfigureKestrel(options => | ||
{ | ||
options.ListenUnixSocket(socketPath, listenOptions => | ||
{ | ||
listenOptions.Protocols = HttpProtocols.Http2; | ||
}); | ||
}); | ||
|
||
builder.Services.AddGrpc(); | ||
builder.Services.AddSingleton(dispatcher); | ||
var app = builder.Build(); | ||
app.MapGrpcService<BicepExtensionImpl>(); | ||
|
||
await app.RunAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters