Skip to content

Commit

Permalink
Move linux build to AppVeyor (#3574)
Browse files Browse the repository at this point in the history
* Move linux build to AppVeyor, no longer use Travis, update Readme to reflect move away from Travis and MyGet

* relax SDK check, falling behind is handled by dotnet CLI properly already

* move to dotnet test (xunit is removed in later versions)

* explicit test reporter

* coverlet does not work yet but hopeful coverlet-coverage/coverlet#329 fixes it in the future

* include integration tests on azure pipelines

* job names are not allowed spaces

* disable integration tests for now against master

* Update readme.md

Co-Authored-By: Mpdreamz <Mpdreamz@gmail.com>
(cherry picked from commit 67d9b69)
  • Loading branch information
Mpdreamz committed Mar 25, 2019
1 parent 954cead commit 03afd79
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 70 deletions.
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

24 changes: 16 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 40 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 0 additions & 2 deletions build/scripts/Building.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
[
Expand Down
24 changes: 17 additions & 7 deletions build/scripts/Testing.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() =
Expand All @@ -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() =
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "2.1.300"
"version": "2.2.103"
},
"version": "5.6.6"
}
45 changes: 15 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,58 @@ Repository for both **NEST** and **Elasticsearch.Net**, the two official [elasti
<th><b>Elasticsearch<b></th>
<th><b>Clients<b></th>
<th><b>Supported<b></th>
<th><b>Windows CI</b></th>
<th><b>Linux CI</b></th>
<th><b>Nuget<b></th>
<th><b>CI Feed<b></th>
<th><b>Windows/Linux CI</b></th>
<th><b>Tests<b></th>
</tr>
<tr>
<td><code>0.x</code></td>
<td><code>0.x</code></td>
<td>:x:</td>
<td>:heavy_minus_sign:</td>
<td>:heavy_minus_sign:</td>
<td>:heavy_minus_sign:</td>
<td>:heavy_minus_sign:</td>
</tr>
<tr>
<td><code>1.x</code></td>
<td><code>1.x</code></td>
<td>:x:</td>
<td>:heavy_minus_sign:</td>
<td>:heavy_minus_sign:</td>
<td><a href="https://www.nuget.org/packages/NEST/1.9.2"><img src="https://img.shields.io/badge/nuget-v1.9.2-blue.svg?style=flat-square"></td>
<td>:heavy_minus_sign:</td>
</tr>
<tr>
<td><code>2.x</code></td>
<td><code>2.x</code></td>
<td>:white_check_mark:</td>
<td><a href="https://ci.appveyor.com/project/Mpdreamz/elasticsearch-net/branch/2.x"><img src="https://ci.appveyor.com/api/projects/status/github/elastic/elasticsearch-net?branch=2.x&svg=true"></a></td>
<td><a href="https://travis-ci.org/elastic/elasticsearch-net/branches"><img src="https://travis-ci.org/elastic/elasticsearch-net.svg?branch=2.x"></a></td>
<td><a href="https://www.nuget.org/packages/NEST/2.5.5"><img src="https://img.shields.io/badge/nuget-v2.5.5-blue.svg?style=flat-square"></a>
<td>:x:</td>
<td>:heavy_minus_sign:</td>
<td>:heavy_minus_sign:</td>
</td>
</tr>
<tr>
<td><code>5.x</code></td>
<td><code>5.x</code></td>
<td>:white_check_mark:</td>
<td><a href="https://ci.appveyor.com/project/Mpdreamz/elasticsearch-net/branch/5.x"><img src="https://ci.appveyor.com/api/projects/status/github/elastic/elasticsearch-net?branch=5.x&svg=true"></a></td>
<td><a href="https://travis-ci.org/elastic/elasticsearch-net/branches"><img src="https://travis-ci.org/elastic/elasticsearch-net.svg?branch=5.x"></a></td>
<td><a href="https://www.nuget.org/packages/NEST/5.5.0"><img src="https://img.shields.io/badge/nuget-v5.5.0-blue.svg?style=flat-square"></a> </td>
<td><a href="https://www.myget.org/gallery/elasticsearch-net"><img src="https://img.shields.io/myget/elasticsearch-net-legacy/vpre/NEST.svg?style=flat-square&label=myget&colorB=339900"></a></td>
<td><a href="https://ci.appveyor.com/project/elastic/elasticsearch-net/branch/5.x"><img src="https://ci.appveyor.com/api/projects/status/github/elastic/elasticsearch-net?branch=5.x&svg=true"></a></td>
<td><a href="https://ci.appveyor.com/project/elastic/elasticsearch-net/branch/5.x/tests"><img alt="5.x unit tests" src="https://img.shields.io/appveyor/tests/elastic/elasticsearch-net/5.x.svg?style=flat-square"></a></td>
</tr>
<tr>
<td><code>6.x</code></td>
<td><code>6.x</code></td>
<td>:white_check_mark:</td>
<td><a href="https://ci.appveyor.com/project/Mpdreamz/elasticsearch-net/branch/6.x"><img src="https://ci.appveyor.com/api/projects/status/github/elastic/elasticsearch-net?branch=6.x&svg=true"></a></td>
<td><a href="https://travis-ci.org/elastic/elasticsearch-net/branches"><img src="https://travis-ci.org/elastic/elasticsearch-net.svg?branch=6.x"></a></td>
<td><a href="https://www.nuget.org/packages/NEST"><img src="https://img.shields.io/badge/nuget-v5.5.0-blue.svg?style=flat-square"></a> </td>
<td><a href="https://www.myget.org/gallery/elasticsearch-net"><img src="https://img.shields.io/myget/elasticsearch-net/vpre/NEST.svg?style=flat-square&label=myget&colorB=339900"></a></td>
<td><a href="https://ci.appveyor.com/project/elastic/elasticsearch-net/branch/6.x"><img src="https://ci.appveyor.com/api/projects/status/github/elastic/elasticsearch-net?branch=6.x&svg=true"></a></td>
<td><a href="https://ci.appveyor.com/project/elastic/elasticsearch-net/branch/6.x/tests"><img alt="6.x unit tests" src="https://img.shields.io/appveyor/tests/elastic/elasticsearch-net/6.x.svg?style=flat-square"></a></td>
</tr>
<tr>
<td><code>master</code></td>
<td><code>master</code></td>
<td>:x:</td>
<td><a href="https://ci.appveyor.com/project/Mpdreamz/elasticsearch-net/branch/master"><img src="https://ci.appveyor.com/api/projects/status/github/elastic/elasticsearch-net?branch=master&svg=true"></a></td>
<td><a href="https://travis-ci.org/elastic/elasticsearch-net/branches"><img src="https://travis-ci.org/elastic/elasticsearch-net.svg?branch=master"></a></td>
<td>:heavy_minus_sign:</td>
<td><a href="https://www.myget.org/gallery/elasticsearch-net-next"><img src="https://img.shields.io/myget/elasticsearch-net-next/vpre/NEST.svg?style=flat-square&label=myget&colorB=339900"></a></td>
<td><a href="https://ci.appveyor.com/project/Mpdreamz/elasticsearch-net/branch/master"><img src="https://ci.appveyor.com/api/projects/status/github/elastic/elasticsearch-net?branch=master&svg=true"></a></td>
<td><a href="https://ci.appveyor.com/project/elastic/elasticsearch-net/branch/master/tests"><img alt="master unit tests" src="https://img.shields.io/appveyor/tests/elastic/elasticsearch-net/master.svg?style=flat-square"></a></td>
</tr>
</table>

## 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)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Elasticsearch.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
3 changes: 0 additions & 3 deletions src/Tests/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<VersionSuffix>alpha</VersionSuffix>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
</PropertyGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta1-build3642" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tests.Core\Tests.Core.csproj" />
<PackageReference Include="Bogus" Version="22.1.2" />
Expand Down

0 comments on commit 03afd79

Please sign in to comment.