[Fixes #181] Go back to server selected listening ports.
This commit is contained in:
parent
886a985726
commit
8c94d27d6a
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"ASPNETCORE_HTTPS_PORT": "44300",
|
|
||||||
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
"ASPNETCORE_URLS": "https://localhost:44300;http://localhost:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ using Microsoft.Extensions.CommandLineUtils;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
using Microsoft.AspNetCore.Certificates.Generation;
|
using Microsoft.AspNetCore.Certificates.Generation;
|
||||||
using System.Threading;
|
|
||||||
|
|
||||||
namespace Templates.Test.Helpers
|
namespace Templates.Test.Helpers
|
||||||
{
|
{
|
||||||
|
|
@ -23,8 +22,6 @@ namespace Templates.Test.Helpers
|
||||||
private readonly Uri _listeningUri;
|
private readonly Uri _listeningUri;
|
||||||
private readonly HttpClient _httpClient;
|
private readonly HttpClient _httpClient;
|
||||||
private readonly ITestOutputHelper _output;
|
private readonly ITestOutputHelper _output;
|
||||||
private readonly int _httpsPort;
|
|
||||||
private readonly int _httpPort;
|
|
||||||
|
|
||||||
public AspNetProcess(ITestOutputHelper output, string workingDirectory, string projectName, string targetFrameworkOverride, bool publish)
|
public AspNetProcess(ITestOutputHelper output, string workingDirectory, string projectName, string targetFrameworkOverride, bool publish)
|
||||||
{
|
{
|
||||||
|
|
@ -62,12 +59,9 @@ namespace Templates.Test.Helpers
|
||||||
.WaitForExit(assertSuccess: true);
|
.WaitForExit(assertSuccess: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
_httpPort = Interlocked.Increment(ref Port);
|
|
||||||
_httpsPort = Interlocked.Increment(ref Port);
|
|
||||||
var envVars = new Dictionary<string, string>
|
var envVars = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "ASPNETCORE_URLS", $"http://localhost:{_httpPort};https://localhost:{_httpsPort}" },
|
{ "ASPNETCORE_URLS", $"http://localhost:127.0.0.0:0;https://localhost:127.0.0.0:0" }
|
||||||
{ "ASPNETCORE_HTTPS_PORT", $"{_httpsPort}" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!publish)
|
if (!publish)
|
||||||
|
|
@ -99,8 +93,14 @@ namespace Templates.Test.Helpers
|
||||||
|
|
||||||
// Verify we have a valid URL to make requests to
|
// Verify we have a valid URL to make requests to
|
||||||
var listeningUrlString = listeningMessage.Substring(ListeningMessagePrefix.Length);
|
var listeningUrlString = listeningMessage.Substring(ListeningMessagePrefix.Length);
|
||||||
_listeningUri = new Uri(listeningUrlString, UriKind.Absolute);
|
|
||||||
output.WriteLine($"Detected that ASP.NET application is accepting connections on: {listeningUrlString}");
|
output.WriteLine($"Detected that ASP.NET application is accepting connections on: {listeningUrlString}");
|
||||||
|
listeningUrlString = listeningUrlString.Substring(0, listeningUrlString.IndexOf(':')) +
|
||||||
|
"://localhost" +
|
||||||
|
listeningUrlString.Substring(listeningUrlString.LastIndexOf(':'));
|
||||||
|
|
||||||
|
output.WriteLine("Sending requests to " + listeningUrlString);
|
||||||
|
|
||||||
|
_listeningUri = new Uri(listeningUrlString, UriKind.Absolute);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AssertOk(string requestUrl)
|
public void AssertOk(string requestUrl)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue