diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 4583cb9..c688063 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -48,7 +48,7 @@ jobs: run: mvn clean test -Punit-tests - name: Run integration tests - run: mvn clean verify -Pintegration-tests + run: mvn clean verify -Pintegration-tests-basic env: USE_EXTERNAL_OLLAMA_HOST: "true" OLLAMA_HOST: "http://localhost:11434" \ No newline at end of file diff --git a/Makefile b/Makefile index 7b5ad0c..b134b29 100644 --- a/Makefile +++ b/Makefile @@ -26,12 +26,16 @@ unit-tests: apply-formatting @echo "\033[0;34mRunning unit tests...\033[0m" @mvn clean test -Punit-tests -integration-tests: apply-formatting - @echo "\033[0;34mRunning integration tests (local)...\033[0m" +integration-tests-all: apply-formatting + @echo "\033[0;34mRunning integration tests (local - all)...\033[0m" @export USE_EXTERNAL_OLLAMA_HOST=false && mvn clean verify -Pintegration-tests +integration-tests-basic: apply-formatting + @echo "\033[0;34mRunning integration tests (local - basic)...\033[0m" + @export USE_EXTERNAL_OLLAMA_HOST=false && mvn clean verify -Pintegration-tests -Dit.test=WithAuth + integration-tests-remote: apply-formatting - @echo "\033[0;34mRunning integration tests (remote)...\033[0m" + @echo "\033[0;34mRunning integration tests (remote - all)...\033[0m" @export USE_EXTERNAL_OLLAMA_HOST=true && export OLLAMA_HOST=http://192.168.29.229:11434 && mvn clean verify -Pintegration-tests -Dgpg.skip=true doxygen: diff --git a/src/test/java/io/github/ollama4j/integrationtests/WithAuth.java b/src/test/java/io/github/ollama4j/integrationtests/WithAuth.java index 2d8a66c..091830e 100644 --- a/src/test/java/io/github/ollama4j/integrationtests/WithAuth.java +++ b/src/test/java/io/github/ollama4j/integrationtests/WithAuth.java @@ -22,7 +22,6 @@ import io.github.ollama4j.utils.OptionsBuilder; import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.net.URISyntaxException; import java.time.Duration; import java.util.Collections; import java.util.HashMap; @@ -174,14 +173,12 @@ public class WithAuth { // (e.g., OllamaBaseException or IOException) // Optionally, you can assert the type/message of the exception if needed // For now, we treat any exception as a pass for this negative test - return; } } @Test @Order(2) - void testAskModelWithStructuredOutput() - throws OllamaException, IOException, InterruptedException, URISyntaxException { + void testAskModelWithStructuredOutput() throws OllamaException, IOException { api.setBearerAuth(BEARER_AUTH_TOKEN); String model = GENERAL_PURPOSE_MODEL; api.pullModel(model);