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)
1313
1414 var version = Environment . GetEnvironmentVariable ( "NEST_INTEGRATION_VERSION" ) ;
1515 ElasticsearchVersion = string . IsNullOrWhiteSpace ( version ) ? yamlConfiguration . ElasticsearchVersion : version ;
16- if ( string . IsNullOrWhiteSpace ( ElasticsearchVersion ) )
16+ if ( ElasticsearchVersion == null )
1717 throw new Exception ( "Elasticsearch Version could not be determined from env var NEST_INTEGRATION_VERSION nor the test yaml configuration" ) ;
1818
1919 var externalSeed = TryGetEnv ( "NEST_TEST_SEED" , out var seed )
Original file line number Diff line number Diff line change 11using System ;
2+ using Elastic . Stack . Artifacts ;
23
34namespace Tests . Configuration
45{
@@ -11,10 +12,9 @@ public abstract class TestConfigurationBase
1112 public string TestFilter { get ; protected set ; }
1213
1314 /// <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 ; }
1516
16- public bool ElasticsearchVersionIsSnapshot => ! string . IsNullOrWhiteSpace ( ElasticsearchVersion )
17- && ( ElasticsearchVersion . Contains ( "SNAPSHOT" ) || ElasticsearchVersion . Contains ( "latest" ) ) ;
17+ public bool ElasticsearchVersionIsSnapshot => ElasticsearchVersion . ArtifactBuildState == ArtifactBuildState . Snapshot ;
1818
1919 /// <summary> Force a reseed (bootstrap) of the cluster even if checks indicate bootstrap already ran </summary>
2020 public bool ForceReseed { get ; protected set ; }
@@ -69,7 +69,7 @@ public class RandomConfiguration
6969
7070 /// <summary> Randomly enable typed keys on searches (defaults to true) on NEST search requests</summary>
7171 public bool TypedKeys { get ; set ; }
72-
72+
7373 /// <summary> Randomly enable compression on the http requests</summary>
7474 public bool HttpCompression { get ; set ; }
7575 }
Original file line number Diff line number Diff line change 33 <PropertyGroup >
44 <TargetFramework >netstandard2.0</TargetFramework >
55 </PropertyGroup >
6+ <ItemGroup >
7+ <PackageReference Include =" Elastic.Managed" Version =" 0.1.0-ci20191017T152836" />
8+ </ItemGroup >
69</Project >
Original file line number Diff line number Diff line change @@ -11,6 +11,6 @@ public static IConnection CreateConnection(this TestConfigurationBase configurat
1111 configuration . RunIntegrationTests && ! forceInMemory ? ( IConnection ) new HttpConnection ( ) : new InMemoryConnection ( ) ;
1212
1313 public static bool InRange ( this TestConfigurationBase configuration , string range ) =>
14- ElasticVersion . From ( configuration . ElasticsearchVersion ) . InRange ( range ) ;
14+ configuration . ElasticsearchVersion . InRange ( range ) ;
1515 }
1616}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ private static ClientTestClusterConfiguration CreateConfiguration()
3030 } ;
3131
3232 // 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" )
3434 plugins . Add ( new ElasticsearchPlugin ( "analysis-nori" , v => v >= "6.4.0" ) ) ;
3535
3636 return new ClientTestClusterConfiguration ( plugins . ToArray ( ) )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static class TestValueHelper
1313
1414 public static string PercolatorType => InRange ( "<5.0.0-alpha1" ) ? ".percolator" : "query" ;
1515
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 ) ;
1717
1818 public static object Dependant ( object builtin , object source ) => TestConfiguration . Instance . Random . SourceSerializer ? source : builtin ;
1919 }
Original file line number Diff line number Diff line change 1212 </ItemGroup >
1313 <ItemGroup >
1414 <PackageReference Include =" Bogus" Version =" 22.1.2" />
15- <PackageReference Include =" Elastic.Managed" Version =" 0.1.0-ci20191017T152836" />
1615 <PackageReference Include =" Newtonsoft.Json" Version =" 12.0.1" />
1716 <ProjectReference Include =" ..\Tests.Configuration\Tests.Configuration.csproj" />
1817 </ItemGroup >
You can’t perform that action at this time.
0 commit comments