Skip to content

Commit c7290cf

Browse files
committed
Update Elastic abstractions dependencies
This commit updates the Elastic abstractions dependencies to pull in changes that fix caching bugs: elastic/elasticsearch-net-abstractions@94ca414 elastic/elasticsearch-net-abstractions@d17a866
1 parent fc11a00 commit c7290cf

File tree

16 files changed

+53
-30
lines changed

16 files changed

+53
-30
lines changed

build/scripts/Projects.fs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ module Projects =
55
type DotNetFrameworkIdentifier = { MSBuild: string; Nuget: string; DefineConstants: string; }
66

77
type DotNetFramework =
8-
| Net46
98
| NetStandard2_0
9+
| Net461
1010
| NetCoreApp2_1
11-
static member All = [Net46; NetStandard2_0]
11+
static member All = [NetStandard2_0; Net461]
12+
static member AllTests = [NetCoreApp2_1; Net461]
1213
member this.Identifier =
1314
match this with
14-
| Net46 -> { MSBuild = "v4.6"; Nuget = "net461"; DefineConstants = ""; }
1515
| NetStandard2_0 -> { MSBuild = "netstandard2.0"; Nuget = "netstandard2.0"; DefineConstants = ""; }
1616
| NetCoreApp2_1 -> { MSBuild = "netcoreapp2.1"; Nuget = "netcoreapp2.1"; DefineConstants = ""; }
17+
| Net461 -> { MSBuild = "net461"; Nuget = "net461"; DefineConstants = ""; }
1718

1819
type Project =
1920
| Nest

build/scripts/Testing.fs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ module Tests =
4141
let p = ["test"; "."; "-c"; "RELEASE"]
4242
//make sure we only test netcoreapp on linux or requested on the command line to only test-one
4343
match (target, Environment.isLinux) with
44-
| (_, true)
45-
| (Commandline.MultiTarget.One, _) -> ["--framework"; "netcoreapp2.1"] |> List.append p
44+
| (_, true) -> ["--framework"; "netcoreapp2.1"] |> List.append p
45+
| (Commandline.MultiTarget.One, _) ->
46+
let random = new Random()
47+
let fw = DotNetFramework.AllTests |> List.sortBy (fun _ -> random.Next()) |> List.head
48+
["--framework"; fw.Identifier.MSBuild] |> List.append p
4649
| _ -> p
4750
let commandWithCodeCoverage =
4851
// TODO /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
@@ -54,7 +57,11 @@ module Tests =
5457
| (true) -> [ "--logger"; "trx"; "--collect"; "\"Code Coverage\""; "-v"; "m"] |> List.append command
5558
| _ -> command
5659

57-
Tooling.DotNet.ExecInWithTimeout "src/Tests/Tests" commandWithCodeCoverage (TimeSpan.FromMinutes 30.)
60+
if Environment.UserInteractive then
61+
let out = Tooling.DotNet.StartInWithTimeout "src/Tests/Tests" commandWithCodeCoverage (TimeSpan.FromMinutes 30.)
62+
if out.ExitCode <> 0 then failwith "dotnet test failed"
63+
else
64+
Tooling.DotNet.ExecInWithTimeout "src/Tests/Tests" commandWithCodeCoverage (TimeSpan.FromMinutes 30.)
5865

5966
let RunReleaseUnitTests (ArtifactsVersion(version)) =
6067
//xUnit always does its own build, this env var is picked up by Tests.csproj
@@ -78,5 +85,6 @@ module Tests =
7885
| None -> failwith "No versions specified to run integration tests against"
7986
| Some esVersions ->
8087
for esVersion in esVersions do
88+
Environment.setEnvironVar "NEST_INTEGRATION_TEST" "1"
8189
Environment.setEnvironVar "NEST_INTEGRATION_VERSION" esVersion
8290
dotnetTest args.MultiTarget |> ignore

build/scripts/Tooling.fs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,34 @@
22

33
open System
44
open System.IO
5+
open Elastic.Managed.ConsoleWriters
56
open ProcNet
6-
open Fake.IO.Globbing.Operators
77
open ProcNet.Std
88

99
module Tooling =
1010

11-
type ExecResult = { ExitCode: int option; Output: Std.LineOut seq;}
11+
type ExecResult = { ExitCode: int; Output: Std.LineOut seq;}
1212

1313
let private defaultTimeout = TimeSpan.FromMinutes(5.)
1414

15+
let startRedirectedInWithTimeout timeout workinDir bin args =
16+
let startArgs = StartArguments(bin, args |> List.toArray)
17+
if (Option.isSome workinDir) then
18+
startArgs.WorkingDirectory <- Option.defaultValue "" workinDir
19+
if Commandline.isMono then startArgs.WaitForStreamReadersTimeout <- Nullable<TimeSpan>()
20+
let result = Proc.StartRedirected(startArgs, timeout, LineHighlightWriter())
21+
if not result.Completed then failwithf "process failed to complete within %O: %s" timeout bin
22+
if not result.ExitCode.HasValue then failwithf "process yielded no exit code: %s" bin
23+
{ ExitCode = result.ExitCode.Value; Output = seq []}
24+
1525
let readInWithTimeout timeout workinDir bin args =
1626
let startArgs = StartArguments(bin, args |> List.toArray)
1727
if (Option.isSome workinDir) then
1828
startArgs.WorkingDirectory <- Option.defaultValue "" workinDir
1929
let result = Proc.Start(startArgs, timeout, ConsoleOutColorWriter())
2030
if not result.Completed then failwithf "process failed to complete within %O: %s" timeout bin
21-
let exitCode = match result.ExitCode.HasValue with | false -> None | true -> Some result.ExitCode.Value
22-
{ ExitCode = exitCode; Output = seq result.ConsoleOut}
31+
if not result.ExitCode.HasValue then failwithf "process yielded no exit code: %s" bin
32+
{ ExitCode = result.ExitCode.Value; Output = seq result.ConsoleOut}
2333

2434
let read bin args = readInWithTimeout defaultTimeout None bin args
2535

@@ -41,6 +51,8 @@ module Tooling =
4151
type BuildTooling(timeout, path) =
4252
let timeout = match timeout with | Some t -> t | None -> defaultTimeout
4353
member this.Path = path
54+
member this.StartInWithTimeout workingDirectory arguments timeout = startRedirectedInWithTimeout timeout (Some workingDirectory) this.Path arguments
55+
member this.ReadInWithTimeout workingDirectory arguments timeout = readInWithTimeout timeout (Some workingDirectory) this.Path arguments
4456
member this.ExecInWithTimeout workingDirectory arguments timeout = execInWithTimeout timeout (Some workingDirectory) this.Path arguments
4557
member this.ExecWithTimeout arguments timeout = execInWithTimeout timeout None this.Path arguments
4658
member this.ExecIn workingDirectory arguments = this.ExecInWithTimeout workingDirectory arguments timeout

build/scripts/Versioning.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module Versioning =
111111

112112
let valid = (out.ExitCode, out.Output |> Seq.findIndex(fun s -> s.Line.Contains("is valid")))
113113
match valid with
114-
| (Some 0, i) when i >= 0 -> printfn "%s was signed correctly" name
114+
| (0, i) when i >= 0 -> printfn "%s was signed correctly" name
115115
| (_, _) -> failwithf "{0} was not validly signed"
116116

117117
let out = Tooling.read sn ["-T"; dll;]
@@ -122,7 +122,7 @@ module Versioning =
122122

123123
let valid = (out.ExitCode, token)
124124
match valid with
125-
| (Some 0, t) when t = officialToken -> printfn "%s was signed with official key token %s" name t
125+
| (0, t) when t = officialToken -> printfn "%s was signed with official key token %s" name t
126126
| (_, t) -> printfn "%s was not signed with the official token: %s but %s" name officialToken t
127127

128128
let private validateDllStrongName dll name =

build/scripts/scripts.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</PropertyGroup>
6868
<ItemGroup>
6969
<PackageReference Include="Bullseye" Version="2.4.0-rc.2" />
70-
<PackageReference Include="Elastic.Managed" Version="0.1.0-ci20190627T121416" />
70+
<PackageReference Include="Elastic.Managed" Version="0.1.0-ci20190724T022011" />
7171
<PackageReference Include="Fake.Core.Environment" Version="5.15.0" />
7272
<PackageReference Include="Fake.Core.SemVer" Version="5.15.0" />
7373
<PackageReference Include="Fake.IO.FileSystem" Version="5.15.0" />

src/Tests/Tests.Benchmarking/Tests.Benchmarking.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<ProjectReference Include="..\Tests.Core\Tests.Core.csproj" />
1313
</ItemGroup>
1414
<ItemGroup>
15-
<PackageReference Include="BenchmarkDotNet" Version="0.11.4" />
16-
<PackageReference Include="Elastic.BenchmarkDotNetExporter" Version="0.1.0-ci20190328T022354" />
15+
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
16+
<PackageReference Include="Elastic.BenchmarkDotNetExporter" Version="0.1.0-ci20190724T022011" />
1717
<PackageReference Include="LibGit2Sharp" Version="0.26.0-preview-0062" />
1818
</ItemGroup>
1919
</Project>

src/Tests/Tests.Core/Extensions/TestConfigurationExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Elastic.Managed.Configuration;
2+
using Elastic.Stack.Artifacts;
23
using Elasticsearch.Net;
34
using Tests.Configuration;
45

@@ -14,6 +15,6 @@ public static IConnection CreateConnection(this ITestConfiguration configuration
1415
configuration.RunIntegrationTests && !forceInMemory ? configuration.CreateLiveConnection() : new InMemoryConnection();
1516

1617
public static bool InRange(this ITestConfiguration configuration, string range) =>
17-
ElasticsearchVersion.From(configuration.ElasticsearchVersion).InRange(range);
18+
ElasticVersion.From(configuration.ElasticsearchVersion).InRange(range);
1819
}
1920
}

src/Tests/Tests.Core/ManagedElasticsearch/Clusters/ClientTestClusterBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.IO;
22
using Elastic.Managed.Ephemeral;
33
using Elastic.Managed.Ephemeral.Plugins;
4+
using Elastic.Stack.Artifacts.Products;
45
using Elastic.Xunit;
56
using Nest;
67
using Tests.Configuration;

src/Tests/Tests.Core/ManagedElasticsearch/Clusters/IntrusiveOperationCluster.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Elastic.Managed.Ephemeral.Plugins;
2+
using static Elastic.Stack.Artifacts.Products.ElasticsearchPlugin;
23

34
namespace Tests.Core.ManagedElasticsearch.Clusters
45
{
@@ -7,9 +8,7 @@ namespace Tests.Core.ManagedElasticsearch.Clusters
78
/// </summary>
89
public class IntrusiveOperationCluster : ClientTestClusterBase
910
{
10-
public IntrusiveOperationCluster() : base(new ClientTestClusterConfiguration(
11-
ElasticsearchPlugin.IngestGeoIp, ElasticsearchPlugin.IngestAttachment
12-
)
11+
public IntrusiveOperationCluster() : base(new ClientTestClusterConfiguration(IngestGeoIp, IngestAttachment)
1312
{
1413
MaxConcurrency = 1
1514
}) { }

src/Tests/Tests.Core/ManagedElasticsearch/Clusters/IntrusiveOperationSeededCluster.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Elastic.Managed.Ephemeral.Plugins;
22
using Tests.Core.ManagedElasticsearch.NodeSeeders;
3+
using static Elastic.Stack.Artifacts.Products.ElasticsearchPlugin;
34

45
namespace Tests.Core.ManagedElasticsearch.Clusters
56
{
@@ -8,9 +9,7 @@ namespace Tests.Core.ManagedElasticsearch.Clusters
89
/// </summary>
910
public class IntrusiveOperationSeededCluster : ClientTestClusterBase
1011
{
11-
public IntrusiveOperationSeededCluster() : base(new ClientTestClusterConfiguration(
12-
ElasticsearchPlugin.IngestGeoIp, ElasticsearchPlugin.IngestAttachment
13-
)
12+
public IntrusiveOperationSeededCluster() : base(new ClientTestClusterConfiguration(IngestGeoIp, IngestAttachment)
1413
{
1514
MaxConcurrency = 1
1615
}) { }

0 commit comments

Comments
 (0)