From a8878b4a198a4fcd5658c23f07dca14f895d9605 Mon Sep 17 00:00:00 2001 From: Tom Gardham-Pallister Date: Tue, 17 Jan 2017 10:20:49 +0000 Subject: [PATCH] test passing on mac and windows --- build-and-run-tests.bat | 0 build.bat | 0 configuration.yaml | 3 ++ run-tests.bat | 0 src/Ocelot/project.json | 3 +- .../TestConfiguration.cs | 28 ++++++++++++++++++- .../Ocelot.AcceptanceTests/configuration.json | 0 test/Ocelot.AcceptanceTests/project.json | 3 +- test/Ocelot.Benchmarks/project.json | 3 +- test/Ocelot.ManualTest/project.json | 3 +- test/Ocelot.UnitTests/project.json | 3 +- 11 files changed, 40 insertions(+), 6 deletions(-) mode change 100644 => 100755 build-and-run-tests.bat mode change 100644 => 100755 build.bat create mode 100755 configuration.yaml mode change 100644 => 100755 run-tests.bat mode change 100644 => 100755 test/Ocelot.AcceptanceTests/configuration.json diff --git a/build-and-run-tests.bat b/build-and-run-tests.bat old mode 100644 new mode 100755 diff --git a/build.bat b/build.bat old mode 100644 new mode 100755 diff --git a/configuration.yaml b/configuration.yaml new file mode 100755 index 00000000..2e47e77d --- /dev/null +++ b/configuration.yaml @@ -0,0 +1,3 @@ +Routes: +- Downstream: http://localhost:51879/ + Upstream: /heee diff --git a/run-tests.bat b/run-tests.bat old mode 100644 new mode 100755 diff --git a/src/Ocelot/project.json b/src/Ocelot/project.json index 1cecd70c..cd6cbff5 100644 --- a/src/Ocelot/project.json +++ b/src/Ocelot/project.json @@ -30,7 +30,8 @@ "CacheManager.Microsoft.Extensions.Logging": "0.9.2" }, "runtimes": { - "win10-x64": {} + "win10-x64": {}, + "osx.10.11-x64":{} }, "frameworks": { "netcoreapp1.4": { diff --git a/test/Ocelot.AcceptanceTests/TestConfiguration.cs b/test/Ocelot.AcceptanceTests/TestConfiguration.cs index 99c5577c..627d0ff4 100644 --- a/test/Ocelot.AcceptanceTests/TestConfiguration.cs +++ b/test/Ocelot.AcceptanceTests/TestConfiguration.cs @@ -1,8 +1,34 @@ namespace Ocelot.AcceptanceTests { + using System.Runtime.InteropServices; + public static class TestConfiguration { public static double Version => 1.4; - public static string ConfigurationPath => $"./bin/Debug/netcoreapp{Version}/win10-x64/configuration.json"; + //public static string Runtime => "win10-x64"; + public static string ConfigurationPath => GetConfigurationPath(); + + public static string GetConfigurationPath() + { + var osArchitecture = RuntimeInformation.OSArchitecture.ToString(); + + var oSDescription = string.Empty; + + if(RuntimeInformation.OSDescription.ToLower().Contains("darwin")) + { + oSDescription = "osx.10.11"; + } + + if(RuntimeInformation.OSDescription.ToLower().Contains("windows")) + { + oSDescription = "win10"; + } + + var runTime = $"{oSDescription}-{osArchitecture}".ToLower(); + + var configPath = $"./bin/Debug/netcoreapp{Version}/{runTime}/configuration.json"; + + return configPath; + } } } diff --git a/test/Ocelot.AcceptanceTests/configuration.json b/test/Ocelot.AcceptanceTests/configuration.json old mode 100644 new mode 100755 diff --git a/test/Ocelot.AcceptanceTests/project.json b/test/Ocelot.AcceptanceTests/project.json index 21e84e6d..4d33f2d5 100644 --- a/test/Ocelot.AcceptanceTests/project.json +++ b/test/Ocelot.AcceptanceTests/project.json @@ -35,7 +35,8 @@ "TestStack.BDDfy": "4.3.2" }, "runtimes": { - "win10-x64": {} + "win10-x64": {}, + "osx.10.11-x64":{} }, "frameworks": { "netcoreapp1.4": { diff --git a/test/Ocelot.Benchmarks/project.json b/test/Ocelot.Benchmarks/project.json index c4021c17..4c98cf40 100644 --- a/test/Ocelot.Benchmarks/project.json +++ b/test/Ocelot.Benchmarks/project.json @@ -9,7 +9,8 @@ "BenchmarkDotNet": "0.10.1" }, "runtimes": { - "win10-x64": {} + "win10-x64": {}, + "osx.10.11-x64":{} }, "frameworks": { "netcoreapp1.4": { diff --git a/test/Ocelot.ManualTest/project.json b/test/Ocelot.ManualTest/project.json index 7646ffb9..774eabfa 100644 --- a/test/Ocelot.ManualTest/project.json +++ b/test/Ocelot.ManualTest/project.json @@ -19,7 +19,8 @@ "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" }, "runtimes": { - "win10-x64": {} + "win10-x64": {}, + "osx.10.11-x64":{} }, "frameworks": { "netcoreapp1.4": { diff --git a/test/Ocelot.UnitTests/project.json b/test/Ocelot.UnitTests/project.json index 616a9e45..6ab9025a 100644 --- a/test/Ocelot.UnitTests/project.json +++ b/test/Ocelot.UnitTests/project.json @@ -27,7 +27,8 @@ "Microsoft.DotNet.InternalAbstractions": "1.0.0" }, "runtimes": { - "win10-x64": {} + "win10-x64": {}, + "osx.10.11-x64":{} }, "frameworks": { "netcoreapp1.4": {