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 8774c15 commit 7cb86d7
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 54 deletions.
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

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
37 changes: 14 additions & 23 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>:x:</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.8"><img src="https://img.shields.io/badge/nuget-v2.5.8-blue.svg?style=flat-square"></a>
<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.6.4"><img src="https://img.shields.io/badge/nuget-v5.6.4-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/nuget/v/NEST.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
2 changes: 1 addition & 1 deletion src/Elasticsearch.sln
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,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 @@ -9,9 +9,6 @@
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
<DebugSymbols>True</DebugSymbols>
</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 7cb86d7

Please sign in to comment.