From 2b7c26a12380e4dd6aaaad6a3b495747ec14a2dc Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Fri, 25 Jan 2019 14:32:32 -0800 Subject: [PATCH] Dynamically install NGinx Internal/#1525 (#6963) --- .azure/pipelines/ci.yml | 6 ++++++ eng/scripts/cibuild.sh | 2 ++ eng/scripts/install-nginx-linux.sh | 6 ++++++ eng/scripts/install-nginx-mac.sh | 4 ++++ src/Servers/test/FunctionalTests/HelloWorldTest.cs | 2 +- .../test/FunctionalTests/ResponseCompressionTests.cs | 6 +++--- src/Servers/test/FunctionalTests/ResponseTests.cs | 2 +- 7 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 eng/scripts/install-nginx-linux.sh create mode 100755 eng/scripts/install-nginx-mac.sh diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index cb73aafae5..006a83260a 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -24,12 +24,18 @@ jobs: jobDisplayName: "Build and test: macOS" agentOs: macOs buildScript: ./eng/scripts/cibuild.sh + beforeBuild: + - bash: "./eng/scripts/install-nginx-mac.sh" + displayName: Installing Nginx - template: jobs/default-build.yml parameters: jobName: Linux_Build jobDisplayName: "Build and test: Linux" agentOs: Linux buildScript: ./eng/scripts/cibuild.sh + beforeBuild: + - bash: "./eng/scripts/install-nginx-linux.sh" + displayName: Installing Nginx - template: jobs/iisintegration-job.yml parameters: TestGroupName: IIS diff --git a/eng/scripts/cibuild.sh b/eng/scripts/cibuild.sh index 6eab1faa2f..93c21befed 100755 --- a/eng/scripts/cibuild.sh +++ b/eng/scripts/cibuild.sh @@ -2,6 +2,8 @@ set -euo pipefail +export PATH="$PATH:$HOME/nginxinstall/sbin/" + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" repo_root="$DIR/../.." "$repo_root/build.sh" --ci --all --restore --build --pack --test "$@" diff --git a/eng/scripts/install-nginx-linux.sh b/eng/scripts/install-nginx-linux.sh new file mode 100755 index 0000000000..a245308a0c --- /dev/null +++ b/eng/scripts/install-nginx-linux.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +curl -sSL http://nginx.org/download/nginx-1.14.2.tar.gz | tar zxfv - -C /tmp && cd /tmp/nginx-1.14.2/ +./configure --prefix=$HOME/nginxinstall --with-http_ssl_module +make +make install diff --git a/eng/scripts/install-nginx-mac.sh b/eng/scripts/install-nginx-mac.sh new file mode 100755 index 0000000000..b44bd5d928 --- /dev/null +++ b/eng/scripts/install-nginx-mac.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +brew update +brew install openssl nginx diff --git a/src/Servers/test/FunctionalTests/HelloWorldTest.cs b/src/Servers/test/FunctionalTests/HelloWorldTest.cs index 155dacab3e..6e8c6beadd 100644 --- a/src/Servers/test/FunctionalTests/HelloWorldTest.cs +++ b/src/Servers/test/FunctionalTests/HelloWorldTest.cs @@ -20,7 +20,7 @@ namespace ServerComparison.FunctionalTests } public static TestMatrix TestVariants - => TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, /* ServerType.Nginx, https://github.com/aspnet/AspNetCore-Internal/issues/1525 */ ServerType.HttpSys) + => TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys) .WithTfms(Tfm.NetCoreApp30) .WithApplicationTypes(ApplicationType.Portable) .WithAncmVersions(AncmVersion.AspNetCoreModuleV2) diff --git a/src/Servers/test/FunctionalTests/ResponseCompressionTests.cs b/src/Servers/test/FunctionalTests/ResponseCompressionTests.cs index f77eae626f..865949df7c 100644 --- a/src/Servers/test/FunctionalTests/ResponseCompressionTests.cs +++ b/src/Servers/test/FunctionalTests/ResponseCompressionTests.cs @@ -32,7 +32,7 @@ namespace ServerComparison.FunctionalTests } public static TestMatrix NoCompressionTestVariants - => TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, /* ServerType.Nginx, https://github.com/aspnet/AspNetCore-Internal/issues/1525 */ ServerType.HttpSys) + => TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys) .WithTfms(Tfm.NetCoreApp30) .WithAncmVersions(AncmVersion.AspNetCoreModuleV2) .WithAllHostingModels(); @@ -45,7 +45,7 @@ namespace ServerComparison.FunctionalTests } public static TestMatrix HostCompressionTestVariants - => TestMatrix.ForServers(ServerType.IISExpress /*, ServerType.Nginx https://github.com/aspnet/AspNetCore-Internal/issues/1525 */ ) + => TestMatrix.ForServers(ServerType.IISExpress, ServerType.Nginx) .WithTfms(Tfm.NetCoreApp30) .WithAncmVersions(AncmVersion.AspNetCoreModuleV2) .WithAllHostingModels(); @@ -71,7 +71,7 @@ namespace ServerComparison.FunctionalTests } public static TestMatrix HostAndAppCompressionTestVariants - => TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, /* ServerType.Nginx, https://github.com/aspnet/AspNetCore-Internal/issues/1525 */ ServerType.HttpSys) + => TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys) .WithTfms(Tfm.NetCoreApp30) .WithAncmVersions(AncmVersion.AspNetCoreModuleV2) .WithAllHostingModels(); diff --git a/src/Servers/test/FunctionalTests/ResponseTests.cs b/src/Servers/test/FunctionalTests/ResponseTests.cs index 22bb313b51..e3f2245f56 100644 --- a/src/Servers/test/FunctionalTests/ResponseTests.cs +++ b/src/Servers/test/FunctionalTests/ResponseTests.cs @@ -25,7 +25,7 @@ namespace ServerComparison.FunctionalTests } public static TestMatrix TestVariants - => TestMatrix.ForServers(/* ServerType.IISExpress, https://github.com/aspnet/AspNetCore/issues/6168, */ ServerType.Kestrel, /* ServerType.Nginx, https://github.com/aspnet/AspNetCore-Internal/issues/1525 */ ServerType.HttpSys) + => TestMatrix.ForServers(/* ServerType.IISExpress, https://github.com/aspnet/AspNetCore/issues/6168, */ ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys) .WithTfms(Tfm.NetCoreApp30) .WithAncmVersions(AncmVersion.AspNetCoreModuleV2) .WithAllHostingModels();