Skip to content

Commit 636bea9

Browse files
committed
Use test features instead of capabilities
1 parent 1623a0e commit 636bea9

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/synonyms/110_synonyms_invalid.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,7 @@ setup:
317317
---
318318
"Load index with non existent synonyms set":
319319
- requires:
320-
test_runner_features: [ capabilities ]
321-
capabilities:
322-
- method: PUT
323-
path: /{index}
324-
capabilities: [ synonyms_set_lenient_on_non_existing ]
320+
cluster_features: [ synonyms_set_lenient_on_non_existing ]
325321
reason: "requires synonyms_set_lenient_on_non_existing bug fix"
326322
- do:
327323
indices.create:

server/src/main/java/org/elasticsearch/index/IndexFeatures.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ public Set<NodeFeature> getFeatures() {
2323

2424
public static final NodeFeature LOGSDB_NO_HOST_NAME_FIELD = new NodeFeature("index.logsdb_no_host_name_field");
2525

26+
private static final NodeFeature SYNONYMS_SET_LENIENT_ON_NON_EXISTING = new NodeFeature("index.synonyms_set_lenient_on_non_existing");
27+
2628
@Override
2729
public Set<NodeFeature> getTestFeatures() {
28-
return Set.of(LOGSDB_NO_HOST_NAME_FIELD);
30+
return Set.of(LOGSDB_NO_HOST_NAME_FIELD, SYNONYMS_SET_LENIENT_ON_NON_EXISTING);
2931
}
3032
}

server/src/main/java/org/elasticsearch/rest/action/admin/indices/CreateIndexCapabilities.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@ public class CreateIndexCapabilities {
3232

3333
private static final String HUNSPELL_DICT_400 = "hunspell_dict_400";
3434

35-
private static final String SYNONYMS_SET_LENIENT_ON_NON_EXISTING = "synonyms_set_lenient_on_non_existing";
36-
3735
public static final Set<String> CAPABILITIES = Set.of(
3836
LOGSDB_INDEX_MODE_CAPABILITY,
3937
LOOKUP_INDEX_MODE_CAPABILITY,
4038
NESTED_DENSE_VECTOR_SYNTHETIC_TEST,
4139
POORLY_FORMATTED_BAD_REQUEST,
42-
HUNSPELL_DICT_400,
43-
SYNONYMS_SET_LENIENT_ON_NON_EXISTING
40+
HUNSPELL_DICT_400
4441
);
4542
}

0 commit comments

Comments
 (0)