diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLInferenceIngestProcessorIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLInferenceIngestProcessorIT.java index 8b64b36c0e..ae4379cc4e 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLInferenceIngestProcessorIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLInferenceIngestProcessorIT.java @@ -112,6 +112,10 @@ public void testMLInferenceProcessorWithObjectFieldType() throws Exception { String index_name = "daily_index"; createPipelineProcessor(createPipelineRequestBody, "diary_embedding_pipeline"); createIndex(index_name, createIndexRequestBody); + // Skip test if key is null + if (OPENAI_KEY == null) { + return; + } uploadDocument(index_name, "1", uploadDocumentRequestBody); Map document = getDocument(index_name, "1"); List embeddingList = JsonPath.parse(document).read("_source.diary_embedding"); @@ -194,6 +198,10 @@ public void testMLInferenceProcessorWithNestedFieldType() throws Exception { String index_name = "book_index"; createPipelineProcessor(createPipelineRequestBody, "embedding_pipeline"); createIndex(index_name, createIndexRequestBody); + // Skip test if key is null + if (OPENAI_KEY == null) { + return; + } uploadDocument(index_name, "1", uploadDocumentRequestBody); Map document = getDocument(index_name, "1");