Merge branch 'release/2.2'
# Conflicts: # .travis.yml # build/dependencies.props # korebuild-lock.txt
This commit is contained in:
commit
fdae68782c
29
.travis.yml
29
.travis.yml
|
|
@ -1,29 +0,0 @@
|
|||
language: csharp
|
||||
sudo: required
|
||||
dist: trusty
|
||||
env:
|
||||
global:
|
||||
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libunwind8
|
||||
mono: none
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
osx_image: xcode9.3beta
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^release\/.*$/
|
||||
- /^(.*\/)?ci-.*$/
|
||||
before_install:
|
||||
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl nginx;
|
||||
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
|
||||
/usr/local/lib/; else apt-get install nginx; fi
|
||||
install:
|
||||
- export PATH="$PATH:$HOME/nginxinstall/sbin/"
|
||||
script:
|
||||
- ./build.sh
|
||||
|
|
@ -38,10 +38,14 @@ namespace ServerComparison.FunctionalTests
|
|||
|
||||
var deploymentParameters = new DeploymentParameters(variant)
|
||||
{
|
||||
ApplicationPath = Helpers.GetApplicationPath(),
|
||||
ServerConfigTemplateContent = Helpers.GetNginxConfigContent(variant.Server, "nginx.conf"),
|
||||
ApplicationPath = Helpers.GetApplicationPath()
|
||||
};
|
||||
|
||||
if (variant.Server == ServerType.Nginx)
|
||||
{
|
||||
deploymentParameters.ServerConfigTemplateContent = Helpers.GetNginxConfigContent("nginx.conf");
|
||||
}
|
||||
|
||||
using (var deployer = IISApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||
{
|
||||
var deploymentResult = await deployer.DeployAsync();
|
||||
|
|
|
|||
|
|
@ -29,33 +29,10 @@ namespace ServerComparison.FunctionalTests
|
|||
throw new Exception($"Solution root could not be found using {applicationBasePath}");
|
||||
}
|
||||
|
||||
public static string GetConfigContent(ServerType serverType, string iisConfig, string nginxConfig)
|
||||
public static string GetNginxConfigContent(string nginxConfig)
|
||||
{
|
||||
var applicationBasePath = AppContext.BaseDirectory;
|
||||
|
||||
string content = null;
|
||||
if (serverType == ServerType.IISExpress)
|
||||
{
|
||||
content = File.ReadAllText(Path.Combine(applicationBasePath, iisConfig));
|
||||
}
|
||||
else if (serverType == ServerType.Nginx)
|
||||
{
|
||||
content = File.ReadAllText(Path.Combine(applicationBasePath, nginxConfig));
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
public static string GetNginxConfigContent(ServerType serverType, string nginxConfig)
|
||||
{
|
||||
var applicationBasePath = AppContext.BaseDirectory;
|
||||
|
||||
string content = null;
|
||||
if (serverType == ServerType.Nginx)
|
||||
{
|
||||
content = File.ReadAllText(Path.Combine(applicationBasePath, nginxConfig));
|
||||
}
|
||||
|
||||
var content = File.ReadAllText(Path.Combine(applicationBasePath, nginxConfig));
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -9,7 +9,9 @@ using System.Net;
|
|||
using System.Net.Http;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
||||
using Microsoft.AspNetCore.Server.IntegrationTesting.IIS;
|
||||
using Microsoft.AspNetCore.Testing.xunit;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Testing;
|
||||
|
|
@ -81,9 +83,9 @@ namespace ServerComparison.FunctionalTests
|
|||
return ResponseCompression(variant, CheckAppCompressionAsync, hostCompression: true);
|
||||
}
|
||||
|
||||
private async Task ResponseCompression(TestVariant variant,
|
||||
Func<HttpClient, ILogger, Task> scenario,
|
||||
bool hostCompression,
|
||||
private async Task ResponseCompression(TestVariant variant,
|
||||
Func<HttpClient, ILogger, Task> scenario,
|
||||
bool hostCompression,
|
||||
[CallerMemberName] string testName = null)
|
||||
{
|
||||
testName = $"{testName}_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||
|
|
@ -96,13 +98,37 @@ namespace ServerComparison.FunctionalTests
|
|||
ApplicationPath = Helpers.GetApplicationPath(),
|
||||
EnvironmentName = "ResponseCompression",
|
||||
};
|
||||
if (hostCompression)
|
||||
|
||||
if (variant.Server == ServerType.Nginx)
|
||||
{
|
||||
deploymentParameters.ServerConfigTemplateContent = Helpers.GetNginxConfigContent(variant.Server, "nginx.conf");
|
||||
deploymentParameters.ServerConfigTemplateContent = hostCompression
|
||||
? Helpers.GetNginxConfigContent("nginx.conf")
|
||||
: Helpers.GetNginxConfigContent("NoCompression.conf");
|
||||
}
|
||||
else
|
||||
else if (variant.Server == ServerType.IISExpress && !hostCompression)
|
||||
{
|
||||
deploymentParameters.ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "NoCompression.config", "NoCompression.conf");
|
||||
var iisDeploymentParameters = new IISDeploymentParameters(deploymentParameters);
|
||||
iisDeploymentParameters.ServerConfigActionList.Add(
|
||||
(element, _) => {
|
||||
var compressionElement = element
|
||||
.RequiredElement("system.webServer")
|
||||
.RequiredElement("httpCompression");
|
||||
|
||||
compressionElement
|
||||
.RequiredElement("dynamicTypes")
|
||||
.Elements()
|
||||
.SkipLast(1)
|
||||
.Remove();
|
||||
|
||||
compressionElement
|
||||
.RequiredElement("staticTypes")
|
||||
.Elements()
|
||||
.SkipLast(1)
|
||||
.Remove();
|
||||
// last element in both dynamicTypes and staticTypes disables compression
|
||||
// <add mimeType="*/*" enabled="false" />
|
||||
});
|
||||
deploymentParameters = iisDeploymentParameters;
|
||||
}
|
||||
|
||||
using (var deployer = IISApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||
|
|
|
|||
|
|
@ -87,10 +87,14 @@ namespace ServerComparison.FunctionalTests
|
|||
var deploymentParameters = new DeploymentParameters(variant)
|
||||
{
|
||||
ApplicationPath = Helpers.GetApplicationPath(),
|
||||
EnvironmentName = "Responses",
|
||||
ServerConfigTemplateContent = Helpers.GetNginxConfigContent(variant.Server, "nginx.conf"),
|
||||
EnvironmentName = "Responses"
|
||||
};
|
||||
|
||||
if (variant.Server == ServerType.Nginx)
|
||||
{
|
||||
deploymentParameters.ServerConfigTemplateContent = Helpers.GetNginxConfigContent("nginx.conf");
|
||||
}
|
||||
|
||||
using (var deployer = IISApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||
{
|
||||
var deploymentResult = await deployer.DeployAsync();
|
||||
|
|
|
|||
Loading…
Reference in New Issue