diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 6cb71a5fe..a3b21048f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -40,10 +40,10 @@ jobs: SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - OLLAMA_TESTS_ENABLED: "false" + OLLAMA_AUTOCONF_TESTS_ENABLED: "true" run: | mvn -s settings.xml -Pintegration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \ - -DOLLAMA_TESTS_ENABLED=false --batch-mode --update-snapshots deploy + --batch-mode --update-snapshots deploy - name: Generate Java docs run: mvn javadoc:aggregate @@ -78,33 +78,28 @@ jobs: # The docker-compose and testcontainers modules will be compiled and run in a parallel job -# container-tests: -# name: Container integration tests -# runs-on: ubuntu-latest -# steps: -# - name: Checkout source code -# uses: actions/checkout@v4 -# -# - name: Set up JDK 17 -# uses: actions/setup-java@v4 -# with: -# java-version: '17' -# distribution: 'temurin' -# cache: 'maven' -# -# - name: Configure Testcontainers -# run: | -# echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties -# -# - name: Run Container Integration Tests -# env: -# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} -# SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} -# ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} -# ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} -# run: | -# mvn -s settings.xml -Pintegration-tests verify \ -# -Dskip.docker-compose=false \ -# -Dskip.testcontainers=false \ -# -pl spring-ai-spring-boot-docker-compose,spring-ai-spring-boot-testcontainers \ -# -am --batch-mode \ No newline at end of file + container-tests: + name: docker-compose and testcontainers modules + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Configure Testcontainers + run: | + echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties + + - name: Run Container Integration Tests + run: | + mvn -s settings.xml -Pintegration-tests verify \ + -Dskip.docker-compose=false \ + -Dskip.testcontainers=false \ + -pl spring-ai-spring-boot-docker-compose,spring-ai-spring-boot-testcontainers \ + -am --batch-mode \ No newline at end of file diff --git a/models/spring-ai-ollama/pom.xml b/models/spring-ai-ollama/pom.xml index 9f8e340dd..a0c1b394e 100644 --- a/models/spring-ai-ollama/pom.xml +++ b/models/spring-ai-ollama/pom.xml @@ -98,4 +98,25 @@ test + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + ${skip.model.ollama} + + + + + integration-test + verify + + + + + + diff --git a/models/spring-ai-ollama/src/test/java/org/springframework/ai/ollama/BaseOllamaIT.java b/models/spring-ai-ollama/src/test/java/org/springframework/ai/ollama/BaseOllamaIT.java index c84b49715..419811f30 100644 --- a/models/spring-ai-ollama/src/test/java/org/springframework/ai/ollama/BaseOllamaIT.java +++ b/models/spring-ai-ollama/src/test/java/org/springframework/ai/ollama/BaseOllamaIT.java @@ -30,7 +30,6 @@ import org.springframework.ai.ollama.management.PullModelStrategy; import org.springframework.util.Assert; @Testcontainers -@EnabledIfEnvironmentVariable(named = "OLLAMA_TESTS_ENABLED", matches = "true") public abstract class BaseOllamaIT { private static final String OLLAMA_LOCAL_URL = "http://localhost:11434"; diff --git a/pom.xml b/pom.xml index d76d0f4ed..1c19b99f3 100644 --- a/pom.xml +++ b/pom.xml @@ -257,7 +257,7 @@ 9.3 true - + true true true @@ -281,6 +281,10 @@ true true + + + true + diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/ollama/BaseOllamaIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/ollama/BaseOllamaIT.java index b4dbc0ee9..168b3b4df 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/ollama/BaseOllamaIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/ollama/BaseOllamaIT.java @@ -30,9 +30,13 @@ import org.springframework.ai.ollama.management.PullModelStrategy; import org.springframework.util.Assert; @Testcontainers -@EnabledIfEnvironmentVariable(named = "OLLAMA_TESTS_ENABLED", matches = "true") +@EnabledIfEnvironmentVariable(named = "OLLAMA_AUTOCONF_TESTS_ENABLED", matches = "true") public abstract class BaseOllamaIT { + static { + System.out.println("OLLAMA_AUTOCONF_TESTS_ENABLED=" + System.getenv("OLLAMA_AUTOCONF_TESTS_ENABLED")); + System.out.println("System property=" + System.getProperty("OLLAMA_AUTOCONF_TESTS_ENABLED")); + } private static final String OLLAMA_LOCAL_URL = "http://localhost:11434"; private static final Duration DEFAULT_TIMEOUT = Duration.ofMinutes(10); diff --git a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfigurationIT.java b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfigurationIT.java index 821a6be49..184848e30 100644 --- a/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfigurationIT.java +++ b/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfigurationIT.java @@ -86,7 +86,7 @@ public class OpenAiAutoConfigurationIT { .isTrue(); assertThat(response.length).isNotEqualTo(0); - logger.info("Response: " + Arrays.toString(response)); + logger.debug("Response: " + Arrays.toString(response)); }); }