Skip to content

Commit 67d9b69

Browse files
authored
Move linux build to AppVeyor (#3574)
* 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 <[email protected]>
1 parent d8fd163 commit 67d9b69

File tree

10 files changed

+80
-78
lines changed

10 files changed

+80
-78
lines changed

.travis.yml

-18
This file was deleted.

appveyor.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ build_script:
1111

1212
nuget:
1313
disable_publish_on_pr: true
14-
14+
1515
for:
16-
17-
- branches:
18-
only:
19-
- /^(master|\d+\.x)$/
20-
artifacts:
21-
- path: .\build\output\_packages\*.nupkg
22-
name: NuGet
2316

24-
-
25-
matrix:
26-
only:
27-
- image: Ubuntu
17+
- branches:
18+
only:
19+
- /^(master|\d+\.x)$/
20+
artifacts:
21+
- path: .\build\output\_packages\*.nupkg
22+
name: NuGet
23+
24+
-
25+
matrix:
26+
only:
27+
- image: Ubuntu
2828

29-
build_script:
30-
- ./build.sh test-one skipdocs
29+
build_script:
30+
- ./build.sh test-one skipdocs

azure-pipelines.yml

+32-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,40 @@
1-
trigger:
2-
- master
3-
41
jobs:
5-
- job: Linux
2+
- job: LinuxUnitTests
63
pool:
74
vmImage: 'ubuntu-16.04'
85
steps:
96
- script: ./build.sh test-one skipdocs
10-
displayName: build and unit test
11-
- job: Windows
7+
displayName: 'build and unit test'
8+
- task: PublishTestResults@2
9+
inputs:
10+
testRunner: VSTest
11+
testResultsFiles: 'src/Tests/Tests/**/*.trx'
12+
testRunTitle: Linux Unit Tests
13+
14+
- job: WindowsCanaryTests
1215
pool:
1316
vmImage: 'vs2017-win2016'
1417
steps:
15-
- script: build.bat canary
16-
displayName: build and unit test
18+
- script: build.bat canary skipdocs
19+
displayName: 'build and unit test'
20+
- task: PublishTestResults@2
21+
inputs:
22+
testRunner: VSTest
23+
testResultsFiles: 'src/Tests/Tests/**/*.trx'
24+
testRunTitle: Windows Unit Tests
25+
26+
# 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
27+
#- job: WindowsIntegrationTests
28+
# dependsOn: WindowsCanaryTests
29+
# pool:
30+
# vmImage: 'vs2017-win2016'
31+
# strategy:
32+
# maxParallel: 5
33+
# matrix:
34+
# es653:
35+
# esVersion: '6.5.3'
36+
# es632:
37+
# esVersion: '6.3.2'
38+
# steps:
39+
# - script: 'build.bat integrate $(esVersion) skipdocs'
40+
# displayName: '$(esVersion) integration tests'

build/scripts/Building.fsx

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ module Build =
3131

3232
let private compileCore incremental =
3333
if not (DotNetCli.isInstalled()) then failwith "You need to install the dotnet command line SDK to build for .NET Core"
34-
let runningSdkVersion = DotNetCli.getVersion()
35-
if (runningSdkVersion <> pinnedSdkVersion) then failwithf "Attempting to run with dotnet.exe with %s but global.json mandates %s" runningSdkVersion pinnedSdkVersion
3634
let sourceLink = if not incremental && not isMono && runningRelease then "1" else ""
3735
let props =
3836
[

build/scripts/Testing.fsx

+17-7
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ open Versioning
1515

1616

1717
module Tests =
18+
open Fake.Core
1819
open System
1920

20-
let private buildingOnTravis = getEnvironmentVarAsBool "TRAVIS"
21+
let private buildingOnAzurePipeline = getEnvironmentVarAsBool "TF_BUILD"
2122
let private buildingOnTeamCity = match environVarOrNone "TEAMCITY_VERSION" with | Some x -> true | None -> false
2223

2324
let private setLocalEnvVars() =
@@ -39,15 +40,24 @@ module Tests =
3940
let private dotnetTest (target: Commandline.MultiTarget) =
4041
CreateDir Paths.BuildOutput
4142
let command =
42-
let p = ["xunit"; "-parallel"; "all"; "-xml"; "../../.." @@ Paths.Output("TestResults-Desktop-Clr.xml")]
43-
match (target, buildingOnTravis) with
44-
//make sure we don't test against net46 on mono or travis systems
43+
let p = ["test"; "."; "-c"; "RELEASE"]
44+
//make sure we only test netcoreapp on linux or requested on the command line to only test-one
45+
match (target, Environment.isLinux) with
4546
| (_, true)
46-
| (Commandline.MultiTarget.One, _) -> ["-framework"; "netcoreapp2.1"] |> List.append p
47+
| (Commandline.MultiTarget.One, _) -> ["--framework"; "netcoreapp2.1"] |> List.append p
4748
| _ -> p
48-
49+
let commandWithCodeCoverage =
50+
// TODO /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
51+
// Using coverlet.msbuild package
52+
// https://github.com/tonerdo/coverlet/issues/110
53+
// Bites us here as well a PR is up already but not merged will try again afterwards
54+
// https://github.com/tonerdo/coverlet/pull/329
55+
match (buildingOnAzurePipeline) with
56+
| (true) -> [ "--logger"; "trx"; "--collect"; "\"Code Coverage\""; "-v"; "m"] |> List.append command
57+
| _ -> command
58+
4959
let dotnet = Tooling.BuildTooling("dotnet")
50-
let exitCode = dotnet.ExecWithTimeoutIn "src/Tests/Tests" command (TimeSpan.FromMinutes 30.)
60+
let exitCode = dotnet.ExecWithTimeoutIn "src/Tests/Tests" commandWithCodeCoverage (TimeSpan.FromMinutes 30.)
5161
if exitCode > 0 && not buildingOnTeamCity then raise (Exception <| (sprintf "test finished with exitCode %d" exitCode))
5262

5363
let RunReleaseUnitTests() =

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "2.1.300"
3+
"version": "2.2.103"
44
},
55
"version": "7.0.0-alpha1"
66
}

readme.md

+14-23
Original file line numberDiff line numberDiff line change
@@ -6,67 +6,58 @@ Repository for both **NEST** and **Elasticsearch.Net**, the two official [elasti
66
<th><b>Elasticsearch<b></th>
77
<th><b>Clients<b></th>
88
<th><b>Supported<b></th>
9-
<th><b>Windows CI</b></th>
10-
<th><b>Linux CI</b></th>
11-
<th><b>Nuget<b></th>
12-
<th><b>CI Feed<b></th>
9+
<th><b>Windows/Linux CI</b></th>
10+
<th><b>Tests<b></th>
1311
</tr>
1412
<tr>
1513
<td><code>0.x</code></td>
1614
<td><code>0.x</code></td>
1715
<td>:x:</td>
1816
<td>:heavy_minus_sign:</td>
1917
<td>:heavy_minus_sign:</td>
20-
<td>:heavy_minus_sign:</td>
21-
<td>:heavy_minus_sign:</td>
2218
</tr>
2319
<tr>
2420
<td><code>1.x</code></td>
2521
<td><code>1.x</code></td>
2622
<td>:x:</td>
2723
<td>:heavy_minus_sign:</td>
2824
<td>:heavy_minus_sign:</td>
29-
<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>
30-
<td>:heavy_minus_sign:</td>
3125
</tr>
3226
<tr>
3327
<td><code>2.x</code></td>
3428
<td><code>2.x</code></td>
3529
<td>:x:</td>
36-
<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>
37-
<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>
38-
<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>
30+
<td>:heavy_minus_sign:</td>
3931
<td>:heavy_minus_sign:</td>
4032
</td>
4133
</tr>
4234
<tr>
4335
<td><code>5.x</code></td>
4436
<td><code>5.x</code></td>
4537
<td>:white_check_mark:</td>
46-
<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>
47-
<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>
48-
<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>
49-
<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>
38+
<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>
39+
<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>
5040
</tr>
5141
<tr>
5242
<td><code>6.x</code></td>
5343
<td><code>6.x</code></td>
5444
<td>:white_check_mark:</td>
55-
<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>
56-
<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>
57-
<td><a href="https://www.nuget.org/packages/NEST"><img src="https://img.shields.io/nuget/v/NEST.svg?style=flat-square"></a> </td>
58-
<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>
45+
<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>
46+
<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>
5947
</tr>
6048
<tr>
6149
<td><code>master</code></td>
6250
<td><code>master</code></td>
6351
<td>:x:</td>
64-
<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>
65-
<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>
66-
<td>:heavy_minus_sign:</td>
67-
<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>
52+
<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>
53+
<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>
6854
</tr>
6955
</table>
56+
57+
## Preview builds
58+
59+
All branches push new nuget packages on successful CI builds to https://ci.appveyor.com/nuget/elasticsearch-net
60+
7061
7162
### [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)
7263

src/Elasticsearch.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{EAE89579-C
5252
ProjectSection(SolutionItems) = preProject
5353
..\.editorconfig = ..\.editorconfig
5454
..\.gitignore = ..\.gitignore
55-
..\.travis.yml = ..\.travis.yml
5655
..\appveyor.yml = ..\appveyor.yml
5756
..\global.json = ..\global.json
57+
..\azure-pipelines.yml = ..\azure-pipelines.yml
5858
EndProjectSection
5959
EndProject
6060
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuget", "Nuget", "{C7865979-1D1C-46AF-BDE8-1DA6F3ED81B3}"

src/Tests/Tests.Configuration/tests.default.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# tracked by git).
66

77
# mode either u (unit test), i (integration test) or m (mixed mode)
8-
mode: i
8+
mode: u
99
# the elasticsearch version that should be started
1010
# Can be a snapshot version of sonatype or "latest" to get the latest snapshot of sonatype
1111
elasticsearch_version: 6.5.3

src/Tests/Tests/Tests.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
<VersionSuffix>alpha</VersionSuffix>
99
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
1010
</PropertyGroup>
11-
<ItemGroup>
12-
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta1-build3642" />
13-
</ItemGroup>
1411
<ItemGroup>
1512
<ProjectReference Include="..\Tests.Core\Tests.Core.csproj" />
1613
<PackageReference Include="Bogus" Version="22.1.2" />

0 commit comments

Comments
 (0)