From a1b5756107f193bfd6acdd83f3b0504f5ba59884 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Wed, 17 Sep 2025 20:28:58 +0530 Subject: [PATCH] Update Ollama host and clean up integration tests Changed the remote Ollama host IP in Makefile and test setup to 192.168.29.229. Fixed a typo in a test method name and removed unused StringBuffer variables and related assertions from OllamaAPIIntegrationTest. --- Makefile | 2 +- .../integrationtests/OllamaAPIIntegrationTest.java | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 1b532db..ed835ef 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ integration-tests: integration-tests-remote: @echo "\033[0;34mRunning integration tests (remote)...\033[0m" - @export USE_EXTERNAL_OLLAMA_HOST=true && export OLLAMA_HOST=http://192.168.29.223:11434 && mvn clean verify -Pintegration-tests -Dgpg.skip=true + @export USE_EXTERNAL_OLLAMA_HOST=true && export OLLAMA_HOST=http://192.168.29.229:11434 && mvn clean verify -Pintegration-tests -Dgpg.skip=true doxygen: @echo "\033[0;34mGenerating documentation with Doxygen...\033[0m" diff --git a/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java b/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java index 289282f..0d6414d 100644 --- a/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java +++ b/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java @@ -61,6 +61,9 @@ class OllamaAPIIntegrationTest { Boolean.parseBoolean(System.getenv("USE_EXTERNAL_OLLAMA_HOST")); String ollamaHost = System.getenv("OLLAMA_HOST"); + useExternalOllamaHost = true; + ollamaHost ="http://192.168.29.229:11434/"; + if (useExternalOllamaHost) { LOG.info("Using external Ollama host..."); api = new OllamaAPI(ollamaHost); @@ -201,7 +204,7 @@ class OllamaAPIIntegrationTest { @Test @Order(6) - void testGennerateModelWithDefaultOptions() + void testGenerateModelWithDefaultOptions() throws OllamaBaseException, IOException, InterruptedException, URISyntaxException { api.pullModel(GENERAL_PURPOSE_MODEL); boolean raw = false; @@ -665,7 +668,6 @@ class OllamaAPIIntegrationTest { + " Mona Lisa?") .build(); requestModel.setThink(false); - StringBuffer sb = new StringBuffer(); OllamaChatResult chatResult = api.chat( @@ -681,7 +683,6 @@ class OllamaAPIIntegrationTest { assertNotNull(chatResult.getResponseModel()); assertNotNull(chatResult.getResponseModel().getMessage()); assertNotNull(chatResult.getResponseModel().getMessage().getContent()); - assertEquals(sb.toString(), chatResult.getResponseModel().getMessage().getContent()); } @Test @@ -703,7 +704,6 @@ class OllamaAPIIntegrationTest { .withThinking(true) .withKeepAlive("0m") .build(); - StringBuffer sb = new StringBuffer(); OllamaChatResult chatResult = api.chat( @@ -720,10 +720,6 @@ class OllamaAPIIntegrationTest { assertNotNull(chatResult.getResponseModel()); assertNotNull(chatResult.getResponseModel().getMessage()); assertNotNull(chatResult.getResponseModel().getMessage().getContent()); - assertEquals( - sb.toString(), - chatResult.getResponseModel().getMessage().getThinking() - + chatResult.getResponseModel().getMessage().getContent()); } @Test