Skip to content

Commit 1d540a6

Browse files
committed
CI Actions imporvements
1 parent 6acd202 commit 1d540a6

File tree

6 files changed

+59
-36
lines changed

6 files changed

+59
-36
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
4141
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
4242
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
43-
OLLAMA_TESTS_ENABLED: "false"
43+
OLLAMA_AUTOCONF_TESTS_ENABLED: "true"
4444
run: |
4545
mvn -s settings.xml -Pintegration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
46-
-DOLLAMA_TESTS_ENABLED=false --batch-mode --update-snapshots deploy
46+
--batch-mode --update-snapshots deploy
4747
4848
- name: Generate Java docs
4949
run: mvn javadoc:aggregate
@@ -78,33 +78,28 @@ jobs:
7878
7979

8080
# The docker-compose and testcontainers modules will be compiled and run in a parallel job
81-
# container-tests:
82-
# name: Container integration tests
83-
# runs-on: ubuntu-latest
84-
# steps:
85-
# - name: Checkout source code
86-
# uses: actions/checkout@v4
87-
#
88-
# - name: Set up JDK 17
89-
# uses: actions/setup-java@v4
90-
# with:
91-
# java-version: '17'
92-
# distribution: 'temurin'
93-
# cache: 'maven'
94-
#
95-
# - name: Configure Testcontainers
96-
# run: |
97-
# echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties
98-
#
99-
# - name: Run Container Integration Tests
100-
# env:
101-
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
102-
# SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
103-
# ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
104-
# ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
105-
# run: |
106-
# mvn -s settings.xml -Pintegration-tests verify \
107-
# -Dskip.docker-compose=false \
108-
# -Dskip.testcontainers=false \
109-
# -pl spring-ai-spring-boot-docker-compose,spring-ai-spring-boot-testcontainers \
110-
# -am --batch-mode
81+
container-tests:
82+
name: docker-compose and testcontainers modules
83+
runs-on: ubuntu-latest
84+
steps:
85+
- name: Checkout source code
86+
uses: actions/checkout@v4
87+
88+
- name: Set up JDK 17
89+
uses: actions/setup-java@v4
90+
with:
91+
java-version: '17'
92+
distribution: 'temurin'
93+
cache: 'maven'
94+
95+
- name: Configure Testcontainers
96+
run: |
97+
echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties
98+
99+
- name: Run Container Integration Tests
100+
run: |
101+
mvn -s settings.xml -Pintegration-tests verify \
102+
-Dskip.docker-compose=false \
103+
-Dskip.testcontainers=false \
104+
-pl spring-ai-spring-boot-docker-compose,spring-ai-spring-boot-testcontainers \
105+
-am --batch-mode

models/spring-ai-ollama/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,25 @@
9898
<scope>test</scope>
9999
</dependency>
100100
</dependencies>
101+
102+
<build>
103+
<plugins>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-failsafe-plugin</artifactId>
107+
<version>${maven-failsafe-plugin.version}</version>
108+
<configuration>
109+
<skipITs>${skip.model.ollama}</skipITs>
110+
</configuration>
111+
<executions>
112+
<execution>
113+
<goals>
114+
<goal>integration-test</goal>
115+
<goal>verify</goal>
116+
</goals>
117+
</execution>
118+
</executions>
119+
</plugin>
120+
</plugins>
121+
</build>
101122
</project>

models/spring-ai-ollama/src/test/java/org/springframework/ai/ollama/BaseOllamaIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.springframework.util.Assert;
3131

3232
@Testcontainers
33-
@EnabledIfEnvironmentVariable(named = "OLLAMA_TESTS_ENABLED", matches = "true")
3433
public abstract class BaseOllamaIT {
3534

3635
private static final String OLLAMA_LOCAL_URL = "http://localhost:11434";

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
<puppycrawl-tools-checkstyle.version>9.3</puppycrawl-tools-checkstyle.version>
258258
<disable.checks>true</disable.checks>
259259

260-
<!-- Individual vector store skip flags with smoke tests enabled by default -->
260+
<!-- Individual vector store IT skip flags with smoke tests enabled by default -->
261261
<skip.vectorstore.azure-cosmos-db>true</skip.vectorstore.azure-cosmos-db>
262262
<skip.vectorstore.azure>true</skip.vectorstore.azure>
263263
<skip.vectorstore.cassandra>true</skip.vectorstore.cassandra>
@@ -281,6 +281,10 @@
281281
<!-- Container module ITs - skipped by default -->
282282
<skip.docker-compose>true</skip.docker-compose>
283283
<skip.testcontainers>true</skip.testcontainers>
284+
285+
<!-- Ollama Model IT tests - skipped by default -->
286+
<skip.model.ollama>true</skip.model.ollama>
287+
284288
</properties>
285289

286290
<build>

spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/ollama/BaseOllamaIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@
3030
import org.springframework.util.Assert;
3131

3232
@Testcontainers
33-
@EnabledIfEnvironmentVariable(named = "OLLAMA_TESTS_ENABLED", matches = "true")
33+
@EnabledIfEnvironmentVariable(named = "OLLAMA_AUTOCONF_TESTS_ENABLED", matches = "true")
3434
public abstract class BaseOllamaIT {
3535

36+
static {
37+
System.out.println("OLLAMA_AUTOCONF_TESTS_ENABLED=" + System.getenv("OLLAMA_AUTOCONF_TESTS_ENABLED"));
38+
System.out.println("System property=" + System.getProperty("OLLAMA_AUTOCONF_TESTS_ENABLED"));
39+
}
3640
private static final String OLLAMA_LOCAL_URL = "http://localhost:11434";
3741

3842
private static final Duration DEFAULT_TIMEOUT = Duration.ofMinutes(10);

spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/openai/OpenAiAutoConfigurationIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void speech() {
8686
.isTrue();
8787
assertThat(response.length).isNotEqualTo(0);
8888

89-
logger.info("Response: " + Arrays.toString(response));
89+
logger.debug("Response: " + Arrays.toString(response));
9090
});
9191
}
9292

0 commit comments

Comments
 (0)