From 6b692844979a8b095b1cac90f35e1aa1de67de62 Mon Sep 17 00:00:00 2001 From: amithkoujalgi Date: Sat, 30 Aug 2025 21:30:16 +0530 Subject: [PATCH] Update workflow job names and refine integration tests Added descriptive names to jobs in the GitHub Actions workflow for better clarity. In integration tests, replaced GENERAL_PURPOSE_MODEL with TOOLS_MODEL in relevant tests and adjusted logging within lambda expressions for improved output handling. --- .github/workflows/build-on-pull-request.yml | 3 +++ .../integrationtests/OllamaAPIIntegrationTest.java | 12 +++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index 97ad372..92eb888 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -15,6 +15,7 @@ concurrency: jobs: build: + name: Build Java Project runs-on: ubuntu-latest permissions: contents: read @@ -33,12 +34,14 @@ jobs: run: mvn --file pom.xml -U clean package run-tests: + name: Run Unit and Integration Tests needs: build uses: ./.github/workflows/run-tests.yml with: branch: ${{ github.head_ref || github.ref_name }} build-docs: + name: Build Documentation needs: [build, run-tests] runs-on: ubuntu-latest diff --git a/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java b/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java index 710af48..8b67c33 100644 --- a/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java +++ b/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java @@ -155,7 +155,7 @@ class OllamaAPIIntegrationTest { @Order(6) void testGenerateWithStructuredOutput() throws OllamaBaseException, IOException, InterruptedException, URISyntaxException { - api.pullModel(GENERAL_PURPOSE_MODEL); + api.pullModel(TOOLS_MODEL); String prompt = "The sun is shining brightly and is directly overhead at the zenith, casting my shadow over my foot, so it must be noon."; @@ -172,7 +172,7 @@ class OllamaAPIIntegrationTest { }); format.put("required", List.of("isNoon")); - OllamaResult result = api.generate(GENERAL_PURPOSE_MODEL, prompt, format); + OllamaResult result = api.generate(TOOLS_MODEL, prompt, format); assertNotNull(result); assertNotNull(result.getResponse()); @@ -207,7 +207,6 @@ class OllamaAPIIntegrationTest { OllamaResult result = api.generate(GENERAL_PURPOSE_MODEL, "What is the capital of France? And what's France's connection with Mona Lisa?", raw, thinking, new OptionsBuilder().build(), (s) -> { - LOG.info(s); String substring = s.substring(sb.toString().length()); LOG.info(substring); sb.append(substring); @@ -469,9 +468,9 @@ class OllamaAPIIntegrationTest { StringBuffer sb = new StringBuffer(); OllamaChatResult chatResult = api.chat(requestModel, (s) -> { - LOG.info(s); String substring = s.substring(sb.toString().length()); sb.append(substring); + LOG.info(substring); }); assertNotNull(chatResult); assertNotNull(chatResult.getResponseModel()); @@ -492,9 +491,9 @@ class OllamaAPIIntegrationTest { StringBuffer sb = new StringBuffer(); OllamaChatResult chatResult = api.chat(requestModel, (s) -> { - LOG.info(s); String substring = s.substring(sb.toString().length()); sb.append(substring); + LOG.info(substring); }); assertNotNull(chatResult); assertNotNull(chatResult.getResponseModel()); @@ -587,7 +586,6 @@ class OllamaAPIIntegrationTest { OllamaResult result = api.generateWithImageFiles(VISION_MODEL, "What is in this image?", List.of(imageFile), new OptionsBuilder().build(), (s) -> { - LOG.info(s); String substring = s.substring(sb.toString().length()); LOG.info(substring); sb.append(substring); @@ -628,9 +626,9 @@ class OllamaAPIIntegrationTest { StringBuffer sb = new StringBuffer(); OllamaResult result = api.generate(THINKING_TOOL_MODEL, "Who are you?", raw, thinking, new OptionsBuilder().build(), (s) -> { - LOG.info(s); String substring = s.substring(sb.toString().length()); sb.append(substring); + LOG.info(substring); }); assertNotNull(result); assertNotNull(result.getResponse());