Skip to content

Commit 83b05c6

Browse files
authored
Resolve inference release tests failing due to missing feature flag (#131841)
1 parent 1cfc403 commit 83b05c6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

x-pack/plugin/inference/src/yamlRestTest/java/org/elasticsearch/xpack/inference/InferenceRestIT.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99

1010
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1111

12+
import org.elasticsearch.Build;
1213
import org.elasticsearch.client.Request;
1314
import org.elasticsearch.common.Strings;
1415
import org.elasticsearch.common.settings.Settings;
1516
import org.elasticsearch.test.cluster.ElasticsearchCluster;
17+
import org.elasticsearch.test.cluster.FeatureFlag;
1618
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
1719
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
1820
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
@@ -21,6 +23,7 @@
2123

2224
import java.io.IOException;
2325
import java.util.List;
26+
import java.util.Locale;
2427
import java.util.Map;
2528

2629
public class InferenceRestIT extends ESClientYamlSuiteTestCase {
@@ -31,12 +34,17 @@ public class InferenceRestIT extends ESClientYamlSuiteTestCase {
3134
.setting("xpack.security.enabled", "false")
3235
.setting("xpack.security.http.ssl.enabled", "false")
3336
.setting("xpack.license.self_generated.type", "trial")
37+
.feature(FeatureFlag.RERANK_SNIPPETS)
3438
.plugin("inference-service-test")
3539
.distribution(DistributionType.DEFAULT)
3640
.build();
3741

3842
public InferenceRestIT(final ClientYamlTestCandidate testCandidate) {
3943
super(testCandidate);
44+
String testPath = testCandidate.getTestPath();
45+
if (testPath.startsWith("inference/70_text_similarity_rank_retriever") && testPath.toLowerCase(Locale.ROOT).contains("snippet")) {
46+
assumeTrue("Rerank snippets does not work in release builds", Build.current().isSnapshot());
47+
}
4048
}
4149

4250
@Override

0 commit comments

Comments
 (0)