Browse Source

#1158 Feature/dashboard port in tye yaml (#1163)

* Set up tests for new dashboardPort functionality

* Add in new dashboardPort values to test data

* Map from tye.yaml configuration file into Application model

* Core change: apply DashboardPort from configuration (if cli --port argument is not specified)

* Add dashboardPort documentation to the tye schema page

* PR feedback: requested YAML (JSON) schema update
pull/1190/head
Dan Simpson 5 years ago
committed by GitHub
parent
commit
2858fce16a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      docs/reference/schema.md
  2. 5
      src/Microsoft.Tye.Core/ApplicationBuilder.cs
  3. 2
      src/Microsoft.Tye.Core/ApplicationFactory.cs
  4. 2
      src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs
  5. 10
      src/Microsoft.Tye.Core/Serialization/ConfigApplicationParser.cs
  6. 5
      src/Microsoft.Tye.Hosting/Model/Application.cs
  7. 2
      src/Microsoft.Tye.Hosting/TyeHost.cs
  8. 4
      src/schema/tye-schema.json
  9. 2
      src/tye/ApplicationBuilderExtensions.cs
  10. 7
      test/E2ETest/Microsoft.Tye.E2ETests.csproj
  11. 87
      test/E2ETest/TyeRunTests.cs
  12. 34
      test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/single-project.sln
  13. 30
      test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/Program.cs
  14. 44
      test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/Startup.cs
  15. 9
      test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/appsettings.Development.json
  16. 10
      test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/appsettings.json
  17. 8
      test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/test-project.csproj
  18. 7
      test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/tye.yaml
  19. 34
      test/E2ETest/testassets/projects/non-standard-dashboard-port/single-project.sln
  20. 30
      test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/Program.cs
  21. 27
      test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/Properties/launchSettings.json
  22. 44
      test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/Startup.cs
  23. 9
      test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/appsettings.Development.json
  24. 10
      test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/appsettings.json
  25. 8
      test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/test-project.csproj
  26. 7
      test/E2ETest/testassets/projects/non-standard-dashboard-port/tye.yaml
  27. 4
      test/Test.Infrastructure/TestHelpers.cs

8
docs/reference/schema.md

@ -85,6 +85,14 @@ Allows configuring the Docker network used for `tye run`.
If a network is configured, then all services running in containers will connect to the specified network. Otherwise a Docker network will be created with a generated name, and used to connect all containers.
#### `dashboardPort` (int)
Allows configuring the dashboard port used for `tye run`.
If a `--port` is provided via the CLI, it will be used instead.
If no `--port` argument or `dashboardPort` value is specified, Tye will use the default port (8000), or a random port if the default port is in use.
#### `ingress` (`Ingress[]`)
Specifies the list of ingresses.

5
src/Microsoft.Tye.Core/ApplicationBuilder.cs

@ -9,17 +9,20 @@ namespace Microsoft.Tye
{
public sealed class ApplicationBuilder
{
public ApplicationBuilder(FileInfo source, string name, ContainerEngine containerEngine)
public ApplicationBuilder(FileInfo source, string name, ContainerEngine containerEngine, int? dashboardPort)
{
Source = source;
Name = name;
ContainerEngine = containerEngine;
DashboardPort = dashboardPort;
}
public FileInfo Source { get; set; }
public string Name { get; set; }
public int? DashboardPort { get; set; }
public string? Namespace { get; set; }
public ContainerRegistry? Registry { get; set; }

2
src/Microsoft.Tye.Core/ApplicationFactory.cs

@ -30,7 +30,7 @@ namespace Microsoft.Tye
var rootConfig = ConfigFactory.FromFile(source);
rootConfig.Validate();
var root = new ApplicationBuilder(source, rootConfig.Name!, new ContainerEngine(rootConfig.ContainerEngineType))
var root = new ApplicationBuilder(source, rootConfig.Name!, new ContainerEngine(rootConfig.ContainerEngineType), rootConfig.DashboardPort)
{
Namespace = rootConfig.Namespace
};

2
src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs

@ -24,6 +24,8 @@ namespace Microsoft.Tye.ConfigModel
public string? Name { get; set; }
public int? DashboardPort { get; set; }
public string? Namespace { get; set; }
public string? Registry { get; set; }

10
src/Microsoft.Tye.Core/Serialization/ConfigApplicationParser.cs

@ -45,6 +45,16 @@ namespace Tye.Serialization
throw new TyeYamlException($"Unknown container engine: \"{engine}\"");
}
break;
case "dashboardPort":
if (int.TryParse(YamlParser.GetScalarValue(key, child.Value), out var dashboardPort))
{
app.DashboardPort = dashboardPort;
}
else
{
throw new TyeYamlException(child.Key.Start, CoreStrings.FormatMustBeAnInteger(key));
}
break;
case "ingress":
YamlParser.ThrowIfNotYamlSequence(key, child.Value);
ConfigIngressParser.HandleIngress((child.Value as YamlSequenceNode)!, app.Ingress);

5
src/Microsoft.Tye.Hosting/Model/Application.cs

@ -12,13 +12,14 @@ namespace Microsoft.Tye.Hosting.Model
{
public class Application
{
public Application(string name, FileInfo source, Dictionary<string, Service> services, ContainerEngine containerEngine)
public Application(string name, FileInfo source, int? dashboardPort, Dictionary<string, Service> services, ContainerEngine containerEngine)
{
Name = name;
Source = source.FullName;
ContextDirectory = source.DirectoryName!;
Services = services;
ContainerEngine = containerEngine;
DashboardPort = dashboardPort;
}
public string Id { get; } = Guid.NewGuid().ToString();
@ -31,6 +32,8 @@ namespace Microsoft.Tye.Hosting.Model
public ContainerEngine ContainerEngine { get; set; }
public int? DashboardPort { get; set; }
public Dictionary<string, Service> Services { get; }
public Dictionary<object, object> Items { get; } = new Dictionary<object, object>();

2
src/Microsoft.Tye.Hosting/TyeHost.cs

@ -155,7 +155,7 @@ namespace Microsoft.Tye.Hosting
})
.ConfigureWebHostDefaults(builder =>
{
var port = ComputePort(options.Port);
var port = ComputePort(options.Port ?? application.DashboardPort);
_computedPort = port;
builder.Configure(ConfigureApplication)

4
src/schema/tye-schema.json

@ -26,6 +26,10 @@
"description": "The Docker network to use.",
"type": "string"
},
"dashboardPort": {
"description": "Configure the dashboard port used for `tye run`. Can be overridden using the `--port` CLI argument, and falls back to port 8000 if free, or a random port if 8000 is in use.",
"type": "integer"
},
"ingress": {
"description": "The application's ingresses.",
"type": "array",

2
src/tye/ApplicationBuilderExtensions.cs

@ -213,7 +213,7 @@ namespace Microsoft.Tye
services.Add(ingress.Name, new Service(description, ServiceSource.Host));
}
return new Application(application.Name, application.Source, services, application.ContainerEngine) { Network = application.Network };
return new Application(application.Name, application.Source, application.DashboardPort, services, application.ContainerEngine) { Network = application.Network };
}
public static Tye.Hosting.Model.EnvironmentVariable ToHostingEnvironmentVariable(this EnvironmentVariableBuilder builder)

7
test/E2ETest/Microsoft.Tye.E2ETests.csproj

@ -31,6 +31,13 @@
<Content Include="testassets\**\*" CopyToOutputDirectory="PreserveNewest" />
<Compile Remove="testassets\**\*" />
<None Remove="testassets\generate\apps-with-ingress.1.18.yaml" />
<None Remove="testassets\projects\non-standard-dashboard-port\test-project\appsettings.Development.json" />
<None Remove="testassets\projects\non-standard-dashboard-port\test-project\appsettings.json" />
<None Remove="testassets\projects\non-standard-dashboard-port\test-project\Properties\launchSettings.json" />
<None Remove="testassets\projects\non-standard-dashboard-port\tye.yaml" />
<None Remove="testassets\projects\non-standard-dashboard-port-5.0\test-project\appsettings.Development.json" />
<None Remove="testassets\projects\non-standard-dashboard-port-5.0\test-project\appsettings.json" />
<None Remove="testassets\projects\non-standard-dashboard-port-5.0\tye.yaml" />
<Compile Include="..\..\src\shared\KubectlDetector.cs" Link="KubectlDetector.cs" />
</ItemGroup>

87
test/E2ETest/TyeRunTests.cs

@ -1094,6 +1094,93 @@ services:
});
}
[ConditionalTheory]
[SkipIfDockerNotRunning]
[InlineData("non-standard-dashboard-port", "mcr.microsoft.com/dotnet/core/aspnet:3.1", 8005)]
[InlineData("non-standard-dashboard-port-5.0", "mcr.microsoft.com/dotnet/aspnet:5.0", 8006)]
public async Task RunUsesYamlDashboardPort(string projectName, string baseImage, int expectedDashboardPort)
{
using var projectDirectory = CopyTestProjectDirectory(projectName);
var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "tye.yaml"));
var outputContext = new OutputContext(_sink, Verbosity.Debug);
var application = await ApplicationFactory.CreateAsync(outputContext, projectFile);
Assert.Equal(expectedDashboardPort, application.DashboardPort);
var handler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (a, b, c, d) => true,
AllowAutoRedirect = false
};
var client = new HttpClient(new RetryHandler(handler));
await RunHostingApplication(application, new HostOptions() { Docker = true, }, async (app, uri) =>
{
// Make sure the dashboard is running on the expected port
Assert.Equal(expectedDashboardPort, uri.Port);
// Make sure we're running containers
Assert.True(app.Services.All(s => s.Value.Description.RunInfo is DockerRunInfo));
// Ensure correct image used
var dockerRunInfo = app.Services.Single().Value.Description.RunInfo as DockerRunInfo;
Assert.Equal(baseImage, dockerRunInfo?.Image);
// Ensure app runs
var testProjectUri = await GetServiceUrl(client, uri, "test-project");
var response = await client.GetAsync(testProjectUri);
Assert.True(response.IsSuccessStatusCode);
});
}
[ConditionalTheory]
[SkipIfDockerNotRunning]
[InlineData("non-standard-dashboard-port", "mcr.microsoft.com/dotnet/core/aspnet:3.1", 8005)]
[InlineData("non-standard-dashboard-port-5.0", "mcr.microsoft.com/dotnet/aspnet:5.0", 8006)]
public async Task RunCliPortOverridesYamlDashboardPort(string projectName, string baseImage, int tyeYamlDashboardPort)
{
var cliDashboardPort = 8008;
using var projectDirectory = CopyTestProjectDirectory(projectName);
var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "tye.yaml"));
var outputContext = new OutputContext(_sink, Verbosity.Debug);
var application = await ApplicationFactory.CreateAsync(outputContext, projectFile);
Assert.Equal(tyeYamlDashboardPort, application.DashboardPort);
var handler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (a, b, c, d) => true,
AllowAutoRedirect = false
};
var client = new HttpClient(new RetryHandler(handler));
await RunHostingApplication(application, new HostOptions() { Docker = true, Port = cliDashboardPort }, async (app, uri) =>
{
// Make sure the dashboard is running on the expected port passed from the CLI, not the value from tye.yaml
Assert.Equal(cliDashboardPort, uri.Port);
Assert.NotEqual(tyeYamlDashboardPort, uri.Port);
// Make sure we're running containers
Assert.True(app.Services.All(s => s.Value.Description.RunInfo is DockerRunInfo));
// Ensure correct image used
var dockerRunInfo = app.Services.Single().Value.Description.RunInfo as DockerRunInfo;
Assert.Equal(baseImage, dockerRunInfo?.Image);
// Ensure app runs
var testProjectUri = await GetServiceUrl(client, uri, "test-project");
var response = await client.GetAsync(testProjectUri);
Assert.True(response.IsSuccessStatusCode);
});
}
private async Task<string> GetServiceUrl(HttpClient client, Uri uri, string serviceName)
{
var serviceResult = await client.GetStringAsync($"{uri}api/v1/services/{serviceName}");

34
test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/single-project.sln

@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test-project", "test-project\test-project.csproj", "{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|x64.ActiveCfg = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|x64.Build.0 = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|x86.ActiveCfg = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|x86.Build.0 = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|Any CPU.Build.0 = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|x64.ActiveCfg = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|x64.Build.0 = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|x86.ActiveCfg = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

30
test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/Program.cs

@ -0,0 +1,30 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace test_project
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

44
test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/Startup.cs

@ -0,0 +1,44 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace test_project
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGet("/", async context =>
{
await context.Response.WriteAsync("Hello World!");
});
});
}
}
}

9
test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/appsettings.Development.json

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

10
test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/appsettings.json

@ -0,0 +1,10 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}

8
test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/test-project/test-project.csproj

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp5.0</TargetFramework>
<RootNamespace>test_project</RootNamespace>
</PropertyGroup>
</Project>

7
test/E2ETest/testassets/projects/non-standard-dashboard-port-5.0/tye.yaml

@ -0,0 +1,7 @@
# tye application configuration file
# read all about it at https://github.com/dotnet/tye
name: non-standard-dashboard-port
dashboardPort: 8006
services:
- name: test-project
project: test-project/test-project.csproj

34
test/E2ETest/testassets/projects/non-standard-dashboard-port/single-project.sln

@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test-project", "test-project\test-project.csproj", "{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|x64.ActiveCfg = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|x64.Build.0 = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|x86.ActiveCfg = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Debug|x86.Build.0 = Debug|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|Any CPU.Build.0 = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|x64.ActiveCfg = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|x64.Build.0 = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|x86.ActiveCfg = Release|Any CPU
{7D3606B2-7B8E-4ABB-BE0A-E0B18285D8F5}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

30
test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/Program.cs

@ -0,0 +1,30 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace test_project
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

27
test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/Properties/launchSettings.json

@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:18482",
"sslPort": 44344
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"test_project": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

44
test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/Startup.cs

@ -0,0 +1,44 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace test_project
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGet("/", async context =>
{
await context.Response.WriteAsync("Hello World!");
});
});
}
}
}

9
test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/appsettings.Development.json

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

10
test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/appsettings.json

@ -0,0 +1,10 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}

8
test/E2ETest/testassets/projects/non-standard-dashboard-port/test-project/test-project.csproj

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>test_project</RootNamespace>
</PropertyGroup>
</Project>

7
test/E2ETest/testassets/projects/non-standard-dashboard-port/tye.yaml

@ -0,0 +1,7 @@
# tye application configuration file
# read all about it at https://github.com/dotnet/tye
name: non-standard-dashboard-port
dashboardPort: 8005
services:
- name: test-project
project: test-project/test-project.csproj

4
test/Test.Infrastructure/TestHelpers.cs

@ -251,8 +251,8 @@ namespace Test.Infrastructure
var processRunner = new ProcessRunner(logger, replicaRegistry, new ProcessRunnerOptions());
var dockerRunner = new DockerRunner(logger, replicaRegistry);
await processRunner.StartAsync(new Application(host.Application.Name, new FileInfo(host.Application.Source), new Dictionary<string, Service>(), ContainerEngine.Default));
await dockerRunner.StartAsync(new Application(host.Application.Name, new FileInfo(host.Application.Source), new Dictionary<string, Service>(), ContainerEngine.Default));
await processRunner.StartAsync(new Application(host.Application.Name, new FileInfo(host.Application.Source), null, new Dictionary<string, Service>(), ContainerEngine.Default));
await dockerRunner.StartAsync(new Application(host.Application.Name, new FileInfo(host.Application.Source), null, new Dictionary<string, Service>(), ContainerEngine.Default));
}
await DoOperationAndWaitForReplicasToChangeState(host, ReplicaState.Stopped, replicas.Length, replicas.ToHashSet(), new HashSet<string>(), TimeSpan.Zero, Purge);

Loading…
Cancel
Save