From 3d885a64274ce9f5bd32cf566f334fe92b60ec20 Mon Sep 17 00:00:00 2001 From: Adeel Date: Wed, 13 Jul 2016 21:45:07 +0300 Subject: [PATCH] Use NUnit dotnet core test runner Also: * Update `.travis.yml` to use .NET Core released version. * Update `appveyor.yml` with `dotnet pack` and saving package as build artifact (we can configure `deploy:` to NuGet as well). * Minor branding updates including addition of MaxMind-logo and used in project.json -> `iconUrl`. :) * Add ability to set `mmdb` path via command-line argument and environment variable `MAXMIND_BENCHMARK_DB` in `GeoIP2.Benchmark` runner with fallback to CWD/GeoLite2-City.mmdb. * Add ability to set test directory via environment variable `MAXMIND_TEST_BASE_DIR` in `GeoIP2.UnitTests` and falls back to CWD. * Remove `Program.cs` in `UnitTests` project in favour of dotnet-test-nunit runner. --- .travis.yml | 90 ++++++++++++++--------- GeoIP2.Benchmark/Program.cs | 40 +++++++++- GeoIP2.Benchmark/project.json | 8 -- GeoIP2.UnitTests/DatabaseReaderTests.cs | 2 +- GeoIP2.UnitTests/DeserializationTests.cs | 2 +- GeoIP2.UnitTests/Program.cs | 27 ------- GeoIP2.UnitTests/TestUtils.cs | 32 ++++++++ GeoIP2.UnitTests/project.json | 22 ++---- GeoIP2/project.json | 19 +++-- MaxMind-logo.png | Bin 0 -> 11743 bytes appveyor.yml | 55 +++++++++----- global.json | 2 +- 12 files changed, 179 insertions(+), 120 deletions(-) delete mode 100644 GeoIP2.UnitTests/Program.cs create mode 100644 GeoIP2.UnitTests/TestUtils.cs create mode 100644 MaxMind-logo.png diff --git a/.travis.yml b/.travis.yml index e99729e9..fbe9a1de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,52 +1,64 @@ --- -sudo: false -language: csharp -# dotnet cli require Ubuntu 14.04 -sudo: required -dist: trusty - -# dotnet cli require OSX 10.10 -osx_image: xcode7.1 +language: generic addons: apt: packages: + - gettext + - libcurl4-openssl-dev + - libicu-dev + - libssl-dev - libunwind8 - -os: - - osx - - linux + - zlib1g env: - matrix: - - CLI_VERSION: Latest - Configuration: Debug - Framework: netcoreapp1.0 - - CLI_VERSION: Latest - Configuration: Release - Framework: netcoreapp1.0 + global: + - MAXMIND_BENCHMARK_DB=GeoIP2.Benchmark/GeoLite2-City.mmdb + - MAXMIND_TEST_BASE_DIR=GeoIP2.UnitTests + +matrix: + include: + - os: linux + dist: trusty # Ubuntu 14.04 + sudo: required + env: CONFIGURATION=Debug + - os: linux + dist: trusty + sudo: required + env: CONFIGURATION=Release + - os: osx + osx_image: xcode7.2 # macOS 10.11 + env: CONFIGURATION=Debug + - os: osx + osx_image: xcode7.2 + env: CONFIGURATION=Release before_install: # Install OpenSSL + # Also set download URLs obtained from https://www.microsoft.com/net/download#core - if test "$TRAVIS_OS_NAME" == "osx"; then - brew update; brew install openssl; brew link --force openssl; + export DOTNET_SDK_URL="https://go.microsoft.com/fwlink/?LinkID=809128"; + else + export DOTNET_SDK_URL="https://go.microsoft.com/fwlink/?LinkID=809129"; fi - # Download script to install dotnet cli - - curl -L --create-dirs https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh -o ./scripts/install.sh - - export DOTNET_INSTALL_DIR="$PWD/.dotnetcli" - # Install the latest versio of dotnet CLI - - bash ./scripts/install.sh --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR" --no-path + # Install .NET CLI + - mkdir $DOTNET_INSTALL_DIR + - curl -L $DOTNET_SDK_URL -o dotnet_package + - tar -xvzf dotnet_package -C $DOTNET_INSTALL_DIR # Add dotnet to PATH - export PATH="$DOTNET_INSTALL_DIR:$PATH" -install: + # Update submodules - git submodule update --init --recursive + +install: + # Display dotnet version info - which dotnet; if [ $? -eq 0 ]; then echo "Using dotnet:"; @@ -56,20 +68,26 @@ install: exit 1; fi - # Restore dependencies - - dotnet restore + # Hack for: https://github.com/dotnet/cli/issues/3658 + - if test "$TRAVIS_OS_NAME" == "linux"; then + nvm install stable && nvm use stable; + fi + - node -e "jsonPath='./GeoIP2.Benchmark/project.json';data=require(jsonPath);fs=require('fs');delete data.frameworks.net45;fs.writeFileSync(jsonPath, JSON.stringify(data, null, 2))" - - FrameworkLibsMoniker="netstandard1.4" + # Restore Packages + - dotnet restore - # Build projects - - dotnet build -c $Configuration -f $FrameworkLibsMoniker ./GeoIP2 - - dotnet build -c $Configuration -f $Framework ./GeoIP2.Benchmark - - dotnet build -c $Configuration -f $Framework ./GeoIP2.UnitTests + # Build Projects + - dotnet build -c $CONFIGURATION -f netstandard1.4 ./GeoIP2 + - dotnet build -c $CONFIGURATION -f netcoreapp1.0 ./GeoIP2.Benchmark + - dotnet build -c $CONFIGURATION -f netcoreapp1.0 ./GeoIP2.UnitTests script: - # Run tests - - cd ./GeoIP2.UnitTests - - dotnet run -f $Framework -c $Configuration + # Run Benchmark + - dotnet run -f netcoreapp1.0 -c $CONFIGURATION -p GeoIP2.Benchmark + + # Run Unit Tests + - dotnet test -f netcoreapp1.0 -c $CONFIGURATION GeoIP2.UnitTests notifications: email: diff --git a/GeoIP2.Benchmark/Program.cs b/GeoIP2.Benchmark/Program.cs index a6dbb043..df4ec6a7 100644 --- a/GeoIP2.Benchmark/Program.cs +++ b/GeoIP2.Benchmark/Program.cs @@ -4,16 +4,50 @@ using System; using System.Diagnostics; using System.Net; +using System.IO; namespace MaxMind.GeoIP2.Benchmark { - internal class Program + public class Program { private static readonly int COUNT = 200000; - private static void Main(string[] args) + public static void Main(string[] args) { - using (var reader = new DatabaseReader("GeoLite2-City.mmdb", FileAccessMode.Memory)) + // first we check if the command-line argument is provided + string dbPath = args.Length > 0 ? args[0] : null; + if (dbPath != null) + { + if (!File.Exists(dbPath)) + { + throw new Exception("Path provided by command-line argument does not exist!"); + } + } + else + { + // check if environment variable MAXMIND_BENCHMARK_DB is set + dbPath = Environment.GetEnvironmentVariable("MAXMIND_BENCHMARK_DB"); + + if (!string.IsNullOrEmpty(dbPath)) + { + if (!File.Exists(dbPath)) + { + throw new Exception("Path set as environment variable MAXMIND_BENCHMARK_DB does not exist!"); + } + } + else + { + // check if GeoLite2-City.mmdb exists in CWD + dbPath = "GeoLite2-City.mmdb"; + + if (!File.Exists(dbPath)) + { + throw new Exception($"{dbPath} does not exist in current directory!"); + } + } + } + + using (var reader = new DatabaseReader(dbPath, FileAccessMode.Memory)) { Bench("Warm-up for Memory mode", reader); Bench("Memory mode", reader); diff --git a/GeoIP2.Benchmark/project.json b/GeoIP2.Benchmark/project.json index e8047128..9bc9beb8 100644 --- a/GeoIP2.Benchmark/project.json +++ b/GeoIP2.Benchmark/project.json @@ -3,14 +3,6 @@ "name": "MaxMind.GeoIP2.Benchmark", "description": "Benchmark project to validate MaxMind GeoIP2 Database Reader and Web Service Client", - "packOptions": { - "authors": ["MaxMind, Inc."], - "tags": [""], - "projectUrl": "https://github.com/maxmind/MaxMind-DB-Reader-dotnet", - "licenseUrl": "https://github.com/maxmind/MaxMind-DB-Reader-dotnet/blob/v2.0.0/LICENSE", - "copyright": "Copyright © 2013-2016" - }, - "buildOptions": { "emitEntryPoint": true, "keyFile": "../MaxMind.snk" diff --git a/GeoIP2.UnitTests/DatabaseReaderTests.cs b/GeoIP2.UnitTests/DatabaseReaderTests.cs index 09446bc2..835a2402 100644 --- a/GeoIP2.UnitTests/DatabaseReaderTests.cs +++ b/GeoIP2.UnitTests/DatabaseReaderTests.cs @@ -27,7 +27,7 @@ public class DatabaseReaderTests public DatabaseReaderTests() { - var databaseDir = Path.Combine(Program.CurrentDirectory, "TestData", "MaxMind-DB", "test-data"); + var databaseDir = Path.Combine(TestUtils.TestDirectory, "TestData", "MaxMind-DB", "test-data"); _anonymousIpDatabaseFile = Path.Combine(databaseDir, "GeoIP2-Anonymous-IP-Test.mmdb"); _cityDatabaseFile = Path.Combine(databaseDir, "GeoIP2-City-Test.mmdb"); diff --git a/GeoIP2.UnitTests/DeserializationTests.cs b/GeoIP2.UnitTests/DeserializationTests.cs index 694fffac..9b8048f9 100644 --- a/GeoIP2.UnitTests/DeserializationTests.cs +++ b/GeoIP2.UnitTests/DeserializationTests.cs @@ -107,7 +107,7 @@ public void CanDeserializeCountryResponseNewtonsoftJson() public void CanDeserializeFromDatabaseType() { var reader = - new DatabaseReader(Path.Combine(Program.CurrentDirectory, "TestData", "MaxMind-DB", "test-data", "GeoIP2-City-Test.mmdb")); + new DatabaseReader(Path.Combine(TestUtils.TestDirectory, "TestData", "MaxMind-DB", "test-data", "GeoIP2-City-Test.mmdb")); var response = reader.City(IPAddress.Parse("216.160.83.56")); diff --git a/GeoIP2.UnitTests/Program.cs b/GeoIP2.UnitTests/Program.cs deleted file mode 100644 index b9bc21ae..00000000 --- a/GeoIP2.UnitTests/Program.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Reflection; -using NUnit.Common; -using NUnitLite; - -#if NETCOREAPP1_0 -using System.IO; -#endif - -namespace MaxMind.GeoIP2.UnitTests -{ - public static class Program - { - public static string CurrentDirectory => -#if !NETCOREAPP1_0 - Environment.CurrentDirectory; -#else - Directory.GetCurrentDirectory(); -#endif - - public static int Main(string[] args) - { - return new AutoRun(typeof(Program).GetTypeInfo().Assembly) - .Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); - } - } -} diff --git a/GeoIP2.UnitTests/TestUtils.cs b/GeoIP2.UnitTests/TestUtils.cs new file mode 100644 index 00000000..69d5c954 --- /dev/null +++ b/GeoIP2.UnitTests/TestUtils.cs @@ -0,0 +1,32 @@ +using System; +using System.IO; + +namespace MaxMind.GeoIP2.UnitTests +{ + internal static class TestUtils + { + public static string TestDirectory { get; } = GetTestDirectory(); + + private static string GetTestDirectory() + { + // check if environment variable MAXMIND_TEST_BASE_DIR is set + string dbPath = Environment.GetEnvironmentVariable("MAXMIND_TEST_BASE_DIR"); + + if (!string.IsNullOrEmpty(dbPath)) + { + if (!Directory.Exists(dbPath)) + { + throw new Exception("Path set as environment variable MAXMIND_TEST_BASE_DIR does not exist!"); + } + + return dbPath; + } + +#if !NETCOREAPP1_0 + return Environment.CurrentDirectory; +#else + return Directory.GetCurrentDirectory(); +#endif + } + } +} diff --git a/GeoIP2.UnitTests/project.json b/GeoIP2.UnitTests/project.json index 698d7b96..59438e3f 100644 --- a/GeoIP2.UnitTests/project.json +++ b/GeoIP2.UnitTests/project.json @@ -3,20 +3,7 @@ "name": "MaxMind.GeoIP2.UnitTests", "description": "Test project to validate MaxMind GeoIP2 Database Reader and Web Service Client", - "packOptions": { - "authors": ["MaxMind, Inc."], - "tags": [""], - "projectUrl": "https://github.com/maxmind/GeoIP2-dotnet", - "licenseUrl": "https://github.com/maxmind/GeoIP2-dotnet/blob/master/LICENSE", - "copyright": "Copyright © 2013-2016" - }, - - "commands": { - "test": "MaxMind.GeoIP2.UnitTests" - }, - "buildOptions": { - "emitEntryPoint": true, "keyFile": "../MaxMind.snk" }, @@ -24,14 +11,17 @@ "GeoIP2": { "target": "project" }, - "NUnitLite": "3.2.1", + "NUnit": "3.4.0", + "dotnet-test-nunit": "3.4.0-beta-1", "MockHttpSigned": "1.3.0-netstandard-alpha3" }, + "testRunner": "nunit", + "frameworks": { - "net45": {}, + "net451": {}, "netcoreapp1.0": { - "imports": "dnxcore50", + "imports": "portable-net45+win8", "dependencies": { "Microsoft.NETCore.App": { "type": "platform", diff --git a/GeoIP2/project.json b/GeoIP2/project.json index 70194db0..2503d01f 100644 --- a/GeoIP2/project.json +++ b/GeoIP2/project.json @@ -2,17 +2,20 @@ "version": "2.7.0-beta2", "name": "MaxMind.GeoIP2", "description": "MaxMind GeoIP2 Database Reader and Web Service Client", + "packOptions": { - "authors": [ - "MaxMind, Inc." - ], - "tags": [ - "" - ], + "authors": ["Gregory Oschwald", "Mark Fowler"], + "tags": ["maxmind", "ip", "geoip", "geoip2", "geolocation", "ip2location", "iptolocation", "maxmind", "ipv4", "ipv6"], + "iconUrl": "https://raw.githubusercontent.com/maxmind/GeoIP2-dotnet/master/maxmind-logo.png", "projectUrl": "https://github.com/maxmind/GeoIP2-dotnet", "licenseUrl": "https://github.com/maxmind/GeoIP2-dotnet/blob/master/LICENSE", - "copyright": "Copyright © 2013-2016" + "copyright": "Copyright © 2013-2016 MaxMind, Inc.", + "repository": { + "type": "git", + "url": "https://github.com/maxmind/GeoIP2-dotnet" + } }, + "buildOptions": { "keyFile": "../MaxMind.snk", "outputName": "MaxMind.GeoIP2", @@ -20,7 +23,7 @@ }, "dependencies": { "MaxMind.Db": "2.1.1-*", - "Newtonsoft.Json": "9.0.1-beta1" + "Newtonsoft.Json": "9.0.1" }, "frameworks": { "net45": { diff --git a/MaxMind-logo.png b/MaxMind-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..f95b1124b723a4555639b948693f9c75219ea1a0 GIT binary patch literal 11743 zcmd6NWmH^EyCuOBG!V3r5D4yphQ<!zb^;-|ySux)yEctG!2<*f4%6?q z?%ePGxHGfn$E-C!`c$7<&pK77ckQR1+Py=R6{T=qk-tJhLc)=e7XN~1hyM9sq9d;5 zS``_H=7sYYsn19i6BGxC8&nHX1yLlV>PV~yV>Bcrwh$R{Q8jmiExO6WFdIoCDDysvGv?&19zk_IjZTvme`0k0}SAp$i?E?m>&O5xw zpl?Vo2;P3fZ>gLPk)#dhxn702T_4$8WL|a5ua72b$E#Pi?76b|eNogf^S$-aR=-uJ zLUh@E{rWZHjjOBc4@*0{in{T)I88GFV_?cJiEIinadx9pUkvZ#k@#kzxDw1#V2~OlXd;q?uf@2C@OM*>|tDE z90=1ZQQR|5oH*X2thZqFyBttall<}R1p1HK)6vgMRR^4-Ex%C#i;&qPKQwl<0)h=$ zi>-4~&G%$^wP7KVzSLO^6TVcx%%EoD&Rfn@J}-g0uzG0HE7HUl1MwN?)PN{QN_na- zNvc5tDJq}?t~}+gho~>_9`gcYVGhP{pjBQ9imtTY)n`uwR|9N-zpEqdkSZS`Kxe<-xf|Ci?#N_g#WIx@bc!2c+ZdZH;U#PJK4TKf$nL1m7Q%OVohJ&Z#=bp#R zRs=1FAeL?Kto`BGwhkKL;@jTafKS-P33QNDm7aNzK zK?%^IOGLzVIlbrqr)%-(#Hr5g;m34Ewt91_Cdihob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{build}' os: Visual Studio 2015 environment: + global: + MAXMIND_BENCHMARK_DB: GeoIP2.Benchmark/GeoLite2-City.mmdb + MAXMIND_TEST_BASE_DIR: GeoIP2.UnitTests matrix: - - Configuration: Debug - Framework: net45 - - Configuration: Release - Framework: net45 - - Configuration: Debug - Framework: netcoreapp1.0 - - Configuration: Release - Framework: netcoreapp1.0 + - CONFIGURATION: Debug + FRAMEWORK: net45 + SECONDARYFRAMEWORK: net451 + - CONFIGURATION: Release + FRAMEWORK: net45 + SECONDARYFRAMEWORK: net451 + - CONFIGURATION: Debug + FRAMEWORK: netcoreapp1.0 + SECONDARYFRAMEWORK: netcoreapp1.0 + - CONFIGURATION: Release + FRAMEWORK: netcoreapp1.0 + SECONDARYFRAMEWORK: netcoreapp1.0 -build_script: +before_build: - git submodule update --init --recursive + +build_script: - ps: | if (gcm dotnet -errorAction SilentlyContinue) { echo "Using dotnet '$((gcm dotnet).Path)'" @@ -26,26 +35,34 @@ build_script: exit 1 } - # Restore packages + # Restore Packages dotnet restore - if($env:Framework -eq "net45") { + # Set Library Moniker Name + if($env:FRAMEWORK -eq "net45") { $FrameworkLibsMoniker = "net45" } else { $FrameworkLibsMoniker = "netstandard1.4" } - # Build projects - dotnet build -c $env:Configuration -f $FrameworkLibsMoniker .\GeoIP2 - dotnet build -c $env:Configuration -f $env:Framework .\GeoIP2.Benchmark - dotnet build -c $env:Configuration -f $env:Framework .\GeoIP2.UnitTests + # Build Projects + dotnet build -c $env:CONFIGURATION -f $FrameworkLibsMoniker .\GeoIP2 + dotnet build -c $env:CONFIGURATION -f $env:FRAMEWORK .\GeoIP2.Benchmark + dotnet build -c $env:CONFIGURATION -f $env:SECONDARYFRAMEWORK .\GeoIP2.UnitTests test_script: - - ps: | - # Run tests - cd .\GeoIP2.UnitTests + # Run Benchmark + - dotnet run -f %FRAMEWORK% -c %CONFIGURATION% -p GeoIP2.Benchmark + + # Run Unit Tests + - dotnet test -f %SECONDARYFRAMEWORK% -c %CONFIGURATION% GeoIP2.UnitTests + +after_test: + # Run Unit Tests + - dotnet pack -c %CONFIGURATION% GeoIP2 - dotnet run -f $env:Framework -c $env:Configuration +artifacts: + - path: 'GeoIP2\bin\**\*.nupkg' notifications: - auth_token: diff --git a/global.json b/global.json index 4e90323d..e06bb372 100644 --- a/global.json +++ b/global.json @@ -5,6 +5,6 @@ "GeoIP2.UnitTests" ], "sdk": { - "version": "1.0.0-preview1-002702" + "version": "1.0.0-preview2-003121" } }