File tree Expand file tree Collapse file tree 7 files changed +11
-9
lines changed
ManagedElasticsearch/Clusters Expand file tree Collapse file tree 7 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public EnvironmentConfiguration(YamlConfiguration yamlConfiguration)
13
13
14
14
var version = Environment . GetEnvironmentVariable ( "NEST_INTEGRATION_VERSION" ) ;
15
15
ElasticsearchVersion = string . IsNullOrWhiteSpace ( version ) ? yamlConfiguration . ElasticsearchVersion : version ;
16
- if ( string . IsNullOrWhiteSpace ( ElasticsearchVersion ) )
16
+ if ( ElasticsearchVersion == null )
17
17
throw new Exception ( "Elasticsearch Version could not be determined from env var NEST_INTEGRATION_VERSION nor the test yaml configuration" ) ;
18
18
19
19
var externalSeed = TryGetEnv ( "NEST_TEST_SEED" , out var seed )
Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using Elastic . Stack . Artifacts ;
2
3
3
4
namespace Tests . Configuration
4
5
{
@@ -11,10 +12,9 @@ public abstract class TestConfigurationBase
11
12
public string TestFilter { get ; protected set ; }
12
13
13
14
/// <summary> The Elasticsearch version to test against, defined for both unit and integration tests</summary>
14
- public string ElasticsearchVersion { get ; protected set ; }
15
+ public ElasticVersion ElasticsearchVersion { get ; protected set ; }
15
16
16
- public bool ElasticsearchVersionIsSnapshot => ! string . IsNullOrWhiteSpace ( ElasticsearchVersion )
17
- && ( ElasticsearchVersion . Contains ( "SNAPSHOT" ) || ElasticsearchVersion . Contains ( "latest" ) ) ;
17
+ public bool ElasticsearchVersionIsSnapshot => ElasticsearchVersion . ArtifactBuildState == ArtifactBuildState . Snapshot ;
18
18
19
19
/// <summary> Force a reseed (bootstrap) of the cluster even if checks indicate bootstrap already ran </summary>
20
20
public bool ForceReseed { get ; protected set ; }
@@ -69,7 +69,7 @@ public class RandomConfiguration
69
69
70
70
/// <summary> Randomly enable typed keys on searches (defaults to true) on NEST search requests</summary>
71
71
public bool TypedKeys { get ; set ; }
72
-
72
+
73
73
/// <summary> Randomly enable compression on the http requests</summary>
74
74
public bool HttpCompression { get ; set ; }
75
75
}
Original file line number Diff line number Diff line change 3
3
<PropertyGroup >
4
4
<TargetFramework >netstandard2.0</TargetFramework >
5
5
</PropertyGroup >
6
+ <ItemGroup >
7
+ <PackageReference Include =" Elastic.Managed" Version =" 0.1.0-ci20191017T152836" />
8
+ </ItemGroup >
6
9
</Project >
Original file line number Diff line number Diff line change @@ -11,6 +11,6 @@ public static IConnection CreateConnection(this TestConfigurationBase configurat
11
11
configuration . RunIntegrationTests && ! forceInMemory ? ( IConnection ) new HttpConnection ( ) : new InMemoryConnection ( ) ;
12
12
13
13
public static bool InRange ( this TestConfigurationBase configuration , string range ) =>
14
- ElasticVersion . From ( configuration . ElasticsearchVersion ) . InRange ( range ) ;
14
+ configuration . ElasticsearchVersion . InRange ( range ) ;
15
15
}
16
16
}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ private static ClientTestClusterConfiguration CreateConfiguration()
30
30
} ;
31
31
32
32
// TODO: temporary until https://github.com/elastic/elasticsearch-net-abstractions/commit/3977ccb6449870fb4f1e6059be960e12ec5e5125 is released
33
- if ( ElasticVersion . From ( TestClient . Configuration . ElasticsearchVersion ) >= "6.4.0" )
33
+ if ( TestClient . Configuration . ElasticsearchVersion >= "6.4.0" )
34
34
plugins . Add ( new ElasticsearchPlugin ( "analysis-nori" , v => v >= "6.4.0" ) ) ;
35
35
36
36
return new ClientTestClusterConfiguration ( plugins . ToArray ( ) )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static class TestValueHelper
13
13
14
14
public static string PercolatorType => InRange ( "<5.0.0-alpha1" ) ? ".percolator" : "query" ;
15
15
16
- private static bool InRange ( string range ) => ElasticVersion . From ( TestConfiguration . Instance . ElasticsearchVersion ) . InRange ( range ) ;
16
+ private static bool InRange ( string range ) => TestConfiguration . Instance . ElasticsearchVersion . InRange ( range ) ;
17
17
18
18
public static object Dependant ( object builtin , object source ) => TestConfiguration . Instance . Random . SourceSerializer ? source : builtin ;
19
19
}
Original file line number Diff line number Diff line change 12
12
</ItemGroup >
13
13
<ItemGroup >
14
14
<PackageReference Include =" Bogus" Version =" 22.1.2" />
15
- <PackageReference Include =" Elastic.Managed" Version =" 0.1.0-ci20191017T152836" />
16
15
<PackageReference Include =" Newtonsoft.Json" Version =" 12.0.1" />
17
16
<ProjectReference Include =" ..\Tests.Configuration\Tests.Configuration.csproj" />
18
17
</ItemGroup >
You can’t perform that action at this time.
0 commit comments