Skip to content

Commit a98af02

Browse files
committed
Minimize time to run main CI build action
- Add maven properties for all vector stores such as skip.vectorstore.azure-cosmos-db to control IT test execution - Chroma and PGVector IT tests are enabled by default - Docker Compose and Testcontainers module ITs are skipped by default - Add parallel job to run docker-compose and testcontainers ITs
1 parent 4de95b7 commit a98af02

File tree

23 files changed

+520
-4
lines changed

23 files changed

+520
-4
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ jobs:
4141
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
4242
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
4343
OLLAMA_TESTS_ENABLED: "false"
44-
run: mvn -s settings.xml -Pintegration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 -DOLLAMA_TESTS_ENABLED=false --batch-mode --update-snapshots deploy
44+
run: |
45+
mvn -s settings.xml -Pintegration-tests -Pjavadoc -Dfailsafe.rerunFailingTestsCount=3 \
46+
--batch-mode --update-snapshots deploy
4547
4648
- name: Generate Java docs
4749
run: mvn javadoc:aggregate
@@ -73,3 +75,36 @@ jobs:
7375
unzip spring-ai-$PROJECT_VERSION-docs.zip
7476
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $PROJECT_VERSION"
7577
scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION
78+
79+
80+
# 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

pom.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,31 @@
256256
<maven-checkstyle-plugin.failOnViolation>true</maven-checkstyle-plugin.failOnViolation>
257257
<puppycrawl-tools-checkstyle.version>9.3</puppycrawl-tools-checkstyle.version>
258258
<disable.checks>true</disable.checks>
259+
260+
<!-- Individual vector store skip flags with smoke tests enabled by default -->
261+
<skip.vectorstore.azure-cosmos-db>true</skip.vectorstore.azure-cosmos-db>
262+
<skip.vectorstore.azure>true</skip.vectorstore.azure>
263+
<skip.vectorstore.cassandra>true</skip.vectorstore.cassandra>
264+
<skip.vectorstore.chroma>false</skip.vectorstore.chroma> <!-- smoke test -->
265+
<skip.vectorstore.coherence>true</skip.vectorstore.coherence>
266+
<skip.vectorstore.elasticsearch>true</skip.vectorstore.elasticsearch>
267+
<skip.vectorstore.gemfire>true</skip.vectorstore.gemfire>
268+
<skip.vectorstore.hanadb>true</skip.vectorstore.hanadb>
269+
<skip.vectorstore.milvus>true</skip.vectorstore.milvus>
270+
<skip.vectorstore.mongodb-atlas>true</skip.vectorstore.mongodb-atlas>
271+
<skip.vectorstore.neo4j>true</skip.vectorstore.neo4j>
272+
<skip.vectorstore.opensearch>true</skip.vectorstore.opensearch>
273+
<skip.vectorstore.oracle>true</skip.vectorstore.oracle>
274+
<skip.vectorstore.pgvector>false</skip.vectorstore.pgvector> <!-- smoke test -->
275+
<skip.vectorstore.pinecone>true</skip.vectorstore.pinecone>
276+
<skip.vectorstore.qdrant>true</skip.vectorstore.qdrant>
277+
<skip.vectorstore.redis>true</skip.vectorstore.redis>
278+
<skip.vectorstore.typesense>true</skip.vectorstore.typesense>
279+
<skip.vectorstore.weaviate>true</skip.vectorstore.weaviate>
280+
281+
<!-- Container module ITs - skipped by default -->
282+
<skip.docker-compose>true</skip.docker-compose>
283+
<skip.testcontainers>true</skip.testcontainers>
259284
</properties>
260285

261286
<build>
@@ -616,6 +641,31 @@
616641
</plugins>
617642
</build>
618643
</profile>
644+
<!-- Profile to enable all vector store tests -->
645+
<profile>
646+
<id>full-vectorstore-tests</id>
647+
<properties>
648+
<skip.vectorstore.azure-cosmos-db>false</skip.vectorstore.azure-cosmos-db>
649+
<skip.vectorstore.azure>false</skip.vectorstore.azure>
650+
<skip.vectorstore.cassandra>false</skip.vectorstore.cassandra>
651+
<skip.vectorstore.chroma>false</skip.vectorstore.chroma>
652+
<skip.vectorstore.coherence>false</skip.vectorstore.coherence>
653+
<skip.vectorstore.elasticsearch>false</skip.vectorstore.elasticsearch>
654+
<skip.vectorstore.gemfire>false</skip.vectorstore.gemfire>
655+
<skip.vectorstore.hanadb>false</skip.vectorstore.hanadb>
656+
<skip.vectorstore.milvus>false</skip.vectorstore.milvus>
657+
<skip.vectorstore.mongodb-atlas>false</skip.vectorstore.mongodb-atlas>
658+
<skip.vectorstore.neo4j>false</skip.vectorstore.neo4j>
659+
<skip.vectorstore.opensearch>false</skip.vectorstore.opensearch>
660+
<skip.vectorstore.oracle>false</skip.vectorstore.oracle>
661+
<skip.vectorstore.pgvector>false</skip.vectorstore.pgvector>
662+
<skip.vectorstore.pinecone>false</skip.vectorstore.pinecone>
663+
<skip.vectorstore.qdrant>false</skip.vectorstore.qdrant>
664+
<skip.vectorstore.redis>false</skip.vectorstore.redis>
665+
<skip.vectorstore.typesense>false</skip.vectorstore.typesense>
666+
<skip.vectorstore.weaviate>false</skip.vectorstore.weaviate>
667+
</properties>
668+
</profile>
619669
<profile>
620670
<id>test-coverage</id>
621671
<build>

spring-ai-spring-boot-docker-compose/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
</scm>
3737

3838
<properties>
39+
<spring-ai-docker-compose.skipITs>false</spring-ai-docker-compose.skipITs>
3940
</properties>
4041

4142
<dependencies>
@@ -176,4 +177,24 @@
176177

177178
</dependencies>
178179

180+
<build>
181+
<plugins>
182+
<plugin>
183+
<groupId>org.apache.maven.plugins</groupId>
184+
<artifactId>maven-failsafe-plugin</artifactId>
185+
<version>${maven-failsafe-plugin.version}</version>
186+
<configuration>
187+
<skipITs>${skip.docker-compose}</skipITs>
188+
</configuration>
189+
<executions>
190+
<execution>
191+
<goals>
192+
<goal>integration-test</goal>
193+
<goal>verify</goal>
194+
</goals>
195+
</execution>
196+
</executions>
197+
</plugin>
198+
</plugins>
199+
</build>
179200
</project>

spring-ai-spring-boot-testcontainers/pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
</scm>
3838

3939
<properties>
40+
<spring-ai-testcontainers.skipITs>false</spring-ai-testcontainers.skipITs>
4041
</properties>
4142

4243
<dependencies>
@@ -267,4 +268,25 @@
267268

268269
</dependencies>
269270

271+
<build>
272+
<plugins>
273+
<plugin>
274+
<groupId>org.apache.maven.plugins</groupId>
275+
<artifactId>maven-failsafe-plugin</artifactId>
276+
<version>${maven-failsafe-plugin.version}</version>
277+
<configuration>
278+
<skipITs>${skip.testcontainers}</skipITs>
279+
</configuration>
280+
<executions>
281+
<execution>
282+
<goals>
283+
<goal>integration-test</goal>
284+
<goal>verify</goal>
285+
</goals>
286+
</execution>
287+
</executions>
288+
</plugin>
289+
</plugins>
290+
</build>
291+
270292
</project>

vector-stores/spring-ai-azure-cosmos-db-store/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,24 @@
9494

9595
</dependencies>
9696

97+
<build>
98+
<plugins>
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-failsafe-plugin</artifactId>
102+
<version>${maven-failsafe-plugin.version}</version>
103+
<configuration>
104+
<skipITs>${skip.vectorstore.azure-cosmos-db}</skipITs>
105+
</configuration>
106+
<executions>
107+
<execution>
108+
<goals>
109+
<goal>integration-test</goal>
110+
<goal>verify</goal>
111+
</goals>
112+
</execution>
113+
</executions>
114+
</plugin>
115+
</plugins>
116+
</build>
97117
</project>

vector-stores/spring-ai-azure-store/pom.xml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,24 @@
103103
</dependency>
104104

105105
</dependencies>
106-
106+
<build>
107+
<plugins>
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-failsafe-plugin</artifactId>
111+
<version>${maven-failsafe-plugin.version}</version>
112+
<configuration>
113+
<skipITs>${skip.vectorstore.azure}</skipITs>
114+
</configuration>
115+
<executions>
116+
<execution>
117+
<goals>
118+
<goal>integration-test</goal>
119+
<goal>verify</goal>
120+
</goals>
121+
</execution>
122+
</executions>
123+
</plugin>
124+
</plugins>
125+
</build>
107126
</project>

vector-stores/spring-ai-cassandra-store/pom.xml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,24 @@
9393
<scope>test</scope>
9494
</dependency>
9595
</dependencies>
96-
96+
<build>
97+
<plugins>
98+
<plugin>
99+
<groupId>org.apache.maven.plugins</groupId>
100+
<artifactId>maven-failsafe-plugin</artifactId>
101+
<version>${maven-failsafe-plugin.version}</version>
102+
<configuration>
103+
<skipITs>${skip.vectorstore.cassandra}</skipITs>
104+
</configuration>
105+
<executions>
106+
<execution>
107+
<goals>
108+
<goal>integration-test</goal>
109+
<goal>verify</goal>
110+
</goals>
111+
</execution>
112+
</executions>
113+
</plugin>
114+
</plugins>
115+
</build>
97116
</project>

vector-stores/spring-ai-chroma-store/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,24 @@
8989
</dependency>
9090
</dependencies>
9191

92+
<build>
93+
<plugins>
94+
<plugin>
95+
<groupId>org.apache.maven.plugins</groupId>
96+
<artifactId>maven-failsafe-plugin</artifactId>
97+
<version>${maven-failsafe-plugin.version}</version>
98+
<configuration>
99+
<skipITs>${skip.vectorstore.chroma}</skipITs>
100+
</configuration>
101+
<executions>
102+
<execution>
103+
<goals>
104+
<goal>integration-test</goal>
105+
<goal>verify</goal>
106+
</goals>
107+
</execution>
108+
</executions>
109+
</plugin>
110+
</plugins>
111+
</build>
92112
</project>

vector-stores/spring-ai-coherence-store/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,24 @@
8080
</dependency>
8181
</dependencies>
8282

83+
<build>
84+
<plugins>
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-failsafe-plugin</artifactId>
88+
<version>${maven-failsafe-plugin.version}</version>
89+
<configuration>
90+
<skipITs>${skip.vectorstore.coherence}</skipITs>
91+
</configuration>
92+
<executions>
93+
<execution>
94+
<goals>
95+
<goal>integration-test</goal>
96+
<goal>verify</goal>
97+
</goals>
98+
</execution>
99+
</executions>
100+
</plugin>
101+
</plugins>
102+
</build>
83103
</project>

vector-stores/spring-ai-elasticsearch-store/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,24 @@
9696
</dependency>
9797
</dependencies>
9898

99+
<build>
100+
<plugins>
101+
<plugin>
102+
<groupId>org.apache.maven.plugins</groupId>
103+
<artifactId>maven-failsafe-plugin</artifactId>
104+
<version>${maven-failsafe-plugin.version}</version>
105+
<configuration>
106+
<skipITs>${skip.vectorstore.elasticsearch}</skipITs>
107+
</configuration>
108+
<executions>
109+
<execution>
110+
<goals>
111+
<goal>integration-test</goal>
112+
<goal>verify</goal>
113+
</goals>
114+
</execution>
115+
</executions>
116+
</plugin>
117+
</plugins>
118+
</build>
99119
</project>

0 commit comments

Comments
 (0)