Skip to content

Commit f521129

Browse files
committed
Fix integration tests
This commit fixes the integration tests: Name properties for analysis tests need to be unique FieldAlias tests need the field to exist in the index.
1 parent 01591c5 commit f521129

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

src/Tests/Tests.Core/ManagedElasticsearch/NodeSeeders/DefaultSeeder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ private static PropertiesDescriptor<Tag> TagProperties(PropertiesDescriptor<Tag>
322322
)
323323
);
324324

325-
private static PropertiesDescriptor<Developer> DeveloperProperties(PropertiesDescriptor<Developer> props) => props
325+
public static PropertiesDescriptor<Developer> DeveloperProperties(PropertiesDescriptor<Developer> props) => props
326326
.Keyword(s => s
327327
.Name(p => p.OnlineHandle)
328328
)

src/Tests/Tests/Analysis/TokenFilters/TokenFilterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public class KeepTypesTests : TokenFilterAssertionBase<KeepTypesTests>
194194
[SkipVersion("<6.4.0", "The mode option was introduced in https://github.com/elastic/elasticsearch/pull/32012")]
195195
public class KeepTypesModeTests : TokenFilterAssertionBase<KeepTypesTests>
196196
{
197-
public override string Name => "keeptypes";
197+
public override string Name => "keeptypes_mode";
198198
private readonly string[] _types = {"<NUM>", "<SOMETHINGELSE>"};
199199

200200
public override ITokenFilter Initializer => new KeepTypesTokenFilter

src/Tests/Tests/Analysis/Tokenizers/TokenizerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public class NoriTests : TokenizerAssertionBase<NoriTests>
224224
public class CharGroupTests : TokenizerAssertionBase<CharGroupTests>
225225
{
226226
private readonly string[] _chars = {"whitespace", "-", "\n"};
227-
public override string Name => "uax";
227+
public override string Name => "char_group";
228228
public override ITokenizer Initializer => new CharGroupTokenizer
229229
{
230230
TokenizeOnCharacters = _chars

src/Tests/Tests/Mapping/Types/Specialized/FieldAlias/AliasPropertyTests.cs renamed to src/Tests/Tests/Mapping/Types/Specialized/FieldAlias/FieldAliasPropertyTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using Nest;
33
using Tests.Core.ManagedElasticsearch.Clusters;
4+
using Tests.Core.ManagedElasticsearch.NodeSeeders;
45
using Tests.Domain;
56
using Tests.Framework.Integration;
67

@@ -10,6 +11,26 @@ public class FieldAliasPropertyTests : PropertyTestsBase
1011
{
1112
public FieldAliasPropertyTests(WritableCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
1213

14+
protected override ICreateIndexRequest CreateIndexSettings(CreateIndexDescriptor create) => create
15+
.Mappings(m => m
16+
.Map<Project>(mm => mm
17+
.RoutingField(r=>r.Required())
18+
.AutoMap()
19+
.Properties(DefaultSeeder.ProjectProperties)
20+
.Properties<CommitActivity>(props => props
21+
.Object<Developer>(o => o
22+
.AutoMap()
23+
.Name(p => p.Committer)
24+
.Properties(DefaultSeeder.DeveloperProperties)
25+
)
26+
.Text(t => t
27+
.Name(p => p.ProjectName)
28+
.Index(false)
29+
)
30+
)
31+
)
32+
);
33+
1334
protected override object ExpectJson => new
1435
{
1536
properties = new

0 commit comments

Comments
 (0)