diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 18a8259dd33..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: csharp -solution: src/Elasticsearch.sln -script: ./build.sh test-one skipdocs -dist: trusty -mono: 4.6.2 -dotnet: 2.1.300 -env: - global: - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 -addons: - apt: - sources: - - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main' - key_url: 'https://packages.microsoft.com/keys/microsoft.asc' - packages: - - dotnet-sharedframework-microsoft.netcore.app-1.1.2 - - dotnet-sharedframework-microsoft.netcore.app-1.0.5 diff --git a/appveyor.yml b/appveyor.yml index e902cf68bea..f7b6e08f74c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,12 +9,20 @@ build_script: nuget: disable_publish_on_pr: true - + for: - -- branches: - only: - - /^(master|\d+\.x)$/ - artifacts: - - path: .\build\output\_packages\*.nupkg - name: NuGet + + - branches: + only: + - /^(master|\d+\.x)$/ + artifacts: + - path: .\build\output\_packages\*.nupkg + name: NuGet + + - + matrix: + only: + - image: Ubuntu + + build_script: + - ./build.sh test-one skipdocs diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000000..d2f145825a5 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,40 @@ +jobs: +- job: LinuxUnitTests + pool: + vmImage: 'ubuntu-16.04' + steps: + - script: ./build.sh test-one skipdocs + displayName: 'build and unit test' + - task: PublishTestResults@2 + inputs: + testRunner: VSTest + testResultsFiles: 'src/Tests/Tests/**/*.trx' + testRunTitle: Linux Unit Tests + +- job: WindowsCanaryTests + pool: + vmImage: 'vs2017-win2016' + steps: + - script: build.bat canary skipdocs + displayName: 'build and unit test' + - task: PublishTestResults@2 + inputs: + testRunner: VSTest + testResultsFiles: 'src/Tests/Tests/**/*.trx' + testRunTitle: Windows Unit Tests + +# Enable this when backporting to 7.x 6.x and 5.x, master not in integratable state until 7.x stabalizes and merged to master again +#- job: WindowsIntegrationTests +# dependsOn: WindowsCanaryTests +# pool: +# vmImage: 'vs2017-win2016' +# strategy: +# maxParallel: 5 +# matrix: +# es653: +# esVersion: '6.5.3' +# es632: +# esVersion: '6.3.2' +# steps: +# - script: 'build.bat integrate $(esVersion) skipdocs' +# displayName: '$(esVersion) integration tests' diff --git a/build/scripts/Building.fsx b/build/scripts/Building.fsx index 80ba4cfceb3..81160354829 100644 --- a/build/scripts/Building.fsx +++ b/build/scripts/Building.fsx @@ -31,8 +31,6 @@ module Build = let private compileCore incremental = if not (DotNetCli.isInstalled()) then failwith "You need to install the dotnet command line SDK to build for .NET Core" - let runningSdkVersion = DotNetCli.getVersion() - if (runningSdkVersion <> pinnedSdkVersion) then failwithf "Attempting to run with dotnet.exe with %s but global.json mandates %s" runningSdkVersion pinnedSdkVersion let sourceLink = if not incremental && not isMono && runningRelease then "1" else "" let props = [ diff --git a/build/scripts/Testing.fsx b/build/scripts/Testing.fsx index 6b44de99533..ebf0c14b2b3 100644 --- a/build/scripts/Testing.fsx +++ b/build/scripts/Testing.fsx @@ -15,9 +15,10 @@ open Versioning module Tests = + open Fake.Core open System - let private buildingOnTravis = getEnvironmentVarAsBool "TRAVIS" + let private buildingOnAzurePipeline = getEnvironmentVarAsBool "TF_BUILD" let private buildingOnTeamCity = match environVarOrNone "TEAMCITY_VERSION" with | Some x -> true | None -> false let private setLocalEnvVars() = @@ -39,15 +40,24 @@ module Tests = let private dotnetTest (target: Commandline.MultiTarget) = CreateDir Paths.BuildOutput let command = - let p = ["xunit"; "-parallel"; "all"; "-xml"; "../../.." @@ Paths.Output("TestResults-Desktop-Clr.xml")] - match (target, buildingOnTravis) with - //make sure we don't test against net46 on mono or travis systems + let p = ["test"; "."; "-c"; "RELEASE"] + //make sure we only test netcoreapp on linux or requested on the command line to only test-one + match (target, Environment.isLinux) with | (_, true) - | (Commandline.MultiTarget.One, _) -> ["-framework"; "netcoreapp2.1"] |> List.append p + | (Commandline.MultiTarget.One, _) -> ["--framework"; "netcoreapp2.1"] |> List.append p | _ -> p - + let commandWithCodeCoverage = + // TODO /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura + // Using coverlet.msbuild package + // https://github.com/tonerdo/coverlet/issues/110 + // Bites us here as well a PR is up already but not merged will try again afterwards + // https://github.com/tonerdo/coverlet/pull/329 + match (buildingOnAzurePipeline) with + | (true) -> [ "--logger"; "trx"; "--collect"; "\"Code Coverage\""; "-v"; "m"] |> List.append command + | _ -> command + let dotnet = Tooling.BuildTooling("dotnet") - let exitCode = dotnet.ExecWithTimeoutIn "src/Tests/Tests" command (TimeSpan.FromMinutes 30.) + let exitCode = dotnet.ExecWithTimeoutIn "src/Tests/Tests" commandWithCodeCoverage (TimeSpan.FromMinutes 30.) if exitCode > 0 && not buildingOnTeamCity then raise (Exception <| (sprintf "test finished with exitCode %d" exitCode)) let RunReleaseUnitTests() = diff --git a/global.json b/global.json index 01bc3469034..bf8603006cf 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "2.1.300" + "version": "2.2.103" }, "version": "5.6.6" } \ No newline at end of file diff --git a/readme.md b/readme.md index bb6db16ed1f..2669ab4ff2f 100644 --- a/readme.md +++ b/readme.md @@ -6,10 +6,8 @@ Repository for both **NEST** and **Elasticsearch.Net**, the two official [elasti Elasticsearch Clients Supported - Windows CI - Linux CI - Nuget - CI Feed + Windows/Linux CI + Tests 0.x @@ -17,8 +15,6 @@ Repository for both **NEST** and **Elasticsearch.Net**, the two official [elasti :x: :heavy_minus_sign: :heavy_minus_sign: - :heavy_minus_sign: - :heavy_minus_sign: 1.x @@ -26,16 +22,12 @@ Repository for both **NEST** and **Elasticsearch.Net**, the two official [elasti :x: :heavy_minus_sign: :heavy_minus_sign: - - :heavy_minus_sign: 2.x 2.x - :white_check_mark: - - - + :x: + :heavy_minus_sign: :heavy_minus_sign: @@ -43,30 +35,29 @@ Repository for both **NEST** and **Elasticsearch.Net**, the two official [elasti 5.x 5.x :white_check_mark: - - - - + + 5.x unit tests 6.x 6.x :white_check_mark: - - - - + + 6.x unit tests master master :x: - - - :heavy_minus_sign: - + + master unit tests + +## Preview builds + +All branches push new nuget packages on successful CI builds to https://ci.appveyor.com/nuget/elasticsearch-net + ### [Full documentation at https://www.elastic.co/guide/en/elasticsearch/client/net-api/current](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/index.html) @@ -318,12 +309,6 @@ and a small HTTP server will be spun up locally on port 8000 through which you c [Pull Requests](https://github.com/elastic/elasticsearch-net/pulls) are most welcome for areas of documentation that need improving. -## Blog posts - -Starting this section (2016) to list blogposts from our users that might be super helpful in your journey to learn Elasticsearch from a .NET perspective - -- Read how buildclassifieds are using [ElasticSearch with ServiceStack (.NET)](http://buildclassifieds.com/2016/01/22/elasticsearch-and-servicestack/) in helping build a Classifieds Site. - #### Many thanks to: * [Q42](https://q42.nl/) for supporting the development of NEST * [redgate](http://www.red-gate.com) for supplying @Mpdreamz with an ANTS Memory Profiler 8 & ANTS Performance Profiler 8 licenses diff --git a/src/Elasticsearch.sln b/src/Elasticsearch.sln index 430625a6884..2715ba8308b 100644 --- a/src/Elasticsearch.sln +++ b/src/Elasticsearch.sln @@ -48,9 +48,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{EAE89579-C ProjectSection(SolutionItems) = preProject ..\.editorconfig = ..\.editorconfig ..\.gitignore = ..\.gitignore - ..\.travis.yml = ..\.travis.yml ..\appveyor.yml = ..\appveyor.yml ..\global.json = ..\global.json + ..\azure-pipelines.yml = ..\azure-pipelines.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuget", "Nuget", "{C7865979-1D1C-46AF-BDE8-1DA6F3ED81B3}" diff --git a/src/Tests/Tests/Tests.csproj b/src/Tests/Tests/Tests.csproj index 7ecc820616d..5ffb735d02a 100644 --- a/src/Tests/Tests/Tests.csproj +++ b/src/Tests/Tests/Tests.csproj @@ -8,9 +8,6 @@ alpha $(NoWarn);xUnit1013 - - -