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 876d186aea..6a25d20cce 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLInferenceIngestProcessorIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLInferenceIngestProcessorIT.java @@ -115,6 +115,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"); @@ -197,6 +201,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");