Skip to content

Commit f76fcb0

Browse files
Add pattern_text feature flag to logsdb yaml tests (#130399) (#130479)
Patterned text yaml tests in logsdb plugin are failing as they assume the presence of the pattern_text type. Enable the feature flag for the tests. (cherry picked from commit b38d545)
1 parent 1a13d75 commit f76fcb0

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class MapperFeatures implements FeatureSpecification {
4545
static final NodeFeature IVF_FORMAT_CLUSTER_FEATURE = new NodeFeature("mapper.ivf_format_cluster_feature");
4646
static final NodeFeature IVF_NESTED_SUPPORT = new NodeFeature("mapper.ivf_nested_support");
4747
static final NodeFeature SEARCH_LOAD_PER_SHARD = new NodeFeature("mapper.search_load_per_shard");
48+
static final NodeFeature PATTERNED_TEXT = new NodeFeature("mapper.patterned_text");
4849

4950
@Override
5051
public Set<NodeFeature> getTestFeatures() {
@@ -76,7 +77,8 @@ public Set<NodeFeature> getTestFeatures() {
7677
IVF_FORMAT_CLUSTER_FEATURE,
7778
IVF_NESTED_SUPPORT,
7879
SEARCH_LOAD_PER_SHARD,
79-
SPARSE_VECTOR_INDEX_OPTIONS_FEATURE
80+
SPARSE_VECTOR_INDEX_OPTIONS_FEATURE,
81+
PATTERNED_TEXT
8082
);
8183
}
8284
}

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/FeatureFlag.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public enum FeatureFlag {
2121
DOC_VALUES_SKIPPER("es.doc_values_skipper_feature_flag_enabled=true", Version.fromString("8.18.1"), null),
2222
USE_LUCENE101_POSTINGS_FORMAT("es.use_lucene101_postings_format_feature_flag_enabled=true", Version.fromString("9.1.0"), null),
2323
IVF_FORMAT("es.ivf_format_feature_flag_enabled=true", Version.fromString("9.1.0"), null),
24-
LOGS_STREAM("es.logs_stream_feature_flag_enabled=true", Version.fromString("9.1.0"), null);
24+
LOGS_STREAM("es.logs_stream_feature_flag_enabled=true", Version.fromString("9.1.0"), null),
25+
PATTERNED_TEXT("es.patterned_text_feature_flag_enabled=true", Version.fromString("9.2.0"), null);
2526

2627
public final String systemProperty;
2728
public final Version from;

x-pack/plugin/logsdb/src/yamlRestTest/java/org/elasticsearch/xpack/logsdb/LogsdbTestSuiteIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class LogsdbTestSuiteIT extends ESClientYamlSuiteTestCase {
3434
.setting("xpack.license.self_generated.type", "trial")
3535
.feature(FeatureFlag.DOC_VALUES_SKIPPER)
3636
.feature(FeatureFlag.USE_LUCENE101_POSTINGS_FORMAT)
37+
.feature(FeatureFlag.PATTERNED_TEXT)
3738
.build();
3839

3940
public LogsdbTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {

x-pack/plugin/logsdb/src/yamlRestTest/resources/rest-api-spec/test/patternedtext/10_basic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
setup:
2+
- requires:
3+
cluster_features: [ "mapper.patterned_text" ]
4+
reason: "patterned_text mappings are used in this test"
25

36
- do:
47
indices.create:

x-pack/plugin/logsdb/src/yamlRestTest/resources/rest-api-spec/test/patternedtext/20_synthetic_source.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
setup:
2+
- requires:
3+
cluster_features: [ "mapper.patterned_text" ]
4+
reason: "patterned_text mappings are used in this test"
5+
6+
---
17
simple:
28
- do:
39
indices.create:

0 commit comments

Comments
 (0)