From a0e91169657d1607864878acbe215ac6f3ada649 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:10:09 -0700 Subject: [PATCH] fix yaml test issue (#2700) (#2704) Signed-off-by: Mingshi Liu (cherry picked from commit 066652b2b4ee31feefe1824e46c36cef1f6c1890) Co-authored-by: Mingshi Liu --- plugin/build.gradle | 1 + .../opensearch/ml/plugin/PluginClientYamlTestSuiteIT.java | 6 +++--- .../yamlRestTest/resources/rest-api-spec/test/10_basic.yml | 2 +- .../rest-api-spec/test/20_inference_ingest_processor.yml | 7 +++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/plugin/build.gradle b/plugin/build.gradle index 3d688f4b0f..96e4e2d3cf 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -24,6 +24,7 @@ ext { apply plugin: 'opensearch.opensearchplugin' apply plugin: 'opensearch.testclusters' apply plugin: 'opensearch.pluginzip' +apply plugin: 'opensearch.yaml-rest-test' ext { projectSubstitutions = [:] licenseFile = rootProject.file('LICENSE.txt') diff --git a/plugin/src/yamlRestTest/java/org/opensearch/ml/plugin/PluginClientYamlTestSuiteIT.java b/plugin/src/yamlRestTest/java/org/opensearch/ml/plugin/PluginClientYamlTestSuiteIT.java index a7715dce2e..11c8aede28 100644 --- a/plugin/src/yamlRestTest/java/org/opensearch/ml/plugin/PluginClientYamlTestSuiteIT.java +++ b/plugin/src/yamlRestTest/java/org/opensearch/ml/plugin/PluginClientYamlTestSuiteIT.java @@ -6,15 +6,15 @@ */ package org.opensearch.ml.plugin; -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.opensearch.test.rest.yaml.ClientYamlTestCandidate; import org.opensearch.test.rest.yaml.OpenSearchClientYamlSuiteTestCase; +import com.carrotsearch.randomizedtesting.annotations.Name; +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; public class PluginClientYamlTestSuiteIT extends OpenSearchClientYamlSuiteTestCase { - public ConversationalClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { + public PluginClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } diff --git a/plugin/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml b/plugin/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml index fd3c06631f..010d123a30 100644 --- a/plugin/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml +++ b/plugin/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml @@ -5,4 +5,4 @@ h: component - match: - $body: /^plugin\n$/ + $body: /opensearch-ml\n$/ diff --git a/plugin/src/yamlRestTest/resources/rest-api-spec/test/20_inference_ingest_processor.yml b/plugin/src/yamlRestTest/resources/rest-api-spec/test/20_inference_ingest_processor.yml index 43931b5d0a..1d54c37724 100644 --- a/plugin/src/yamlRestTest/resources/rest-api-spec/test/20_inference_ingest_processor.yml +++ b/plugin/src/yamlRestTest/resources/rest-api-spec/test/20_inference_ingest_processor.yml @@ -6,7 +6,10 @@ teardown: ignore: 404 --- -"Test ML Inference Processor": +"Test ML Inference Ingest Processor": + - skip: + version: " - 2.13.99" + reason: "Added in 2.14.0" - do: ingest.put_pipeline: id: "my_pipeline" @@ -21,4 +24,4 @@ teardown: } ] } - - match: { acknowledged: true } \ No newline at end of file + - match: { acknowledged: true }