File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
plugin/src/test/java/org/opensearch/ml/rest Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ public void testMLInferenceProcessorWithObjectFieldType() throws Exception {
112112 String index_name = "daily_index" ;
113113 createPipelineProcessor (createPipelineRequestBody , "diary_embedding_pipeline" );
114114 createIndex (index_name , createIndexRequestBody );
115+ // Skip test if key is null
116+ if (OPENAI_KEY == null ) {
117+ return ;
118+ }
115119 uploadDocument (index_name , "1" , uploadDocumentRequestBody );
116120 Map document = getDocument (index_name , "1" );
117121 List embeddingList = JsonPath .parse (document ).read ("_source.diary_embedding" );
@@ -194,6 +198,10 @@ public void testMLInferenceProcessorWithNestedFieldType() throws Exception {
194198 String index_name = "book_index" ;
195199 createPipelineProcessor (createPipelineRequestBody , "embedding_pipeline" );
196200 createIndex (index_name , createIndexRequestBody );
201+ // Skip test if key is null
202+ if (OPENAI_KEY == null ) {
203+ return ;
204+ }
197205 uploadDocument (index_name , "1" , uploadDocumentRequestBody );
198206 Map document = getDocument (index_name , "1" );
199207
You can’t perform that action at this time.
0 commit comments