Skip to content

Commit 0d1a5d9

Browse files
committed
Disable VectorSearch tests on CI.
Running the VectorSearch tests is flakey on our CI as the container sometimes doesn't start. Closes #5119
1 parent e1e3b10 commit 0d1a5d9

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pipeline {
8383
docker.image("springci/spring-data-with-mongodb-8.0:${p['java.main.tag']}").inside(p['docker.java.inside.docker']) {
8484
sh 'ci/start-replica.sh'
8585
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
86-
"./mvnw -s settings.xml -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-mongodb clean dependency:list test -Dsort -U -B"
86+
"./mvnw -s settings.xml -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-mongodb clean dependency:list test -Dsort -U -B -Pno-vector-search-tests"
8787
}
8888
}
8989
}
@@ -115,7 +115,7 @@ pipeline {
115115
docker.image("springci/spring-data-with-mongodb-8.0:${p['java.next.tag']}").inside(p['docker.java.inside.docker']) {
116116
sh 'ci/start-replica.sh'
117117
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
118-
"./mvnw -s settings.xml -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-mongodb clean dependency:list test -Dsort -U -B"
118+
"./mvnw -s settings.xml -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-mongodb clean dependency:list test -Dsort -U -B -Pno-vector-search-tests"
119119
}
120120
}
121121
}

spring-data-mongodb/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,25 @@
366366
</dependencies>
367367

368368
<profiles>
369+
<profile>
370+
<id>no-vector-search-tests</id>
371+
<build>
372+
<plugins>
373+
<plugin>
374+
<groupId>org.apache.maven.plugins</groupId>
375+
<artifactId>maven-surefire-plugin</artifactId>
376+
<configuration>
377+
<excludes combine.children="append">
378+
<exclude>**/VectorIndexIntegrationTests.java</exclude>
379+
<exclude>**/VectorSearchTests.java</exclude>
380+
<exclude>**/ReactiveVectorSearchTests.java</exclude>
381+
<exclude>**/MongoRepositoryContributorTests.java</exclude>
382+
</excludes>
383+
</configuration>
384+
</plugin>
385+
</plugins>
386+
</build>
387+
</profile>
369388
<profile>
370389
<id>nullaway</id>
371390
<build>
@@ -506,4 +525,5 @@
506525
</plugins>
507526

508527
</build>
528+
509529
</project>

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/VectorSearchTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.bson.Document;
2626
import org.junit.jupiter.api.AfterAll;
2727
import org.junit.jupiter.api.BeforeAll;
28+
import org.junit.jupiter.api.Tag;
2829
import org.junit.jupiter.params.ParameterizedTest;
2930
import org.junit.jupiter.params.provider.Arguments;
3031
import org.junit.jupiter.params.provider.MethodSource;
@@ -50,6 +51,7 @@
5051
* @author Mark Paluch
5152
*/
5253
@Testcontainers(disabledWithoutDocker = true)
54+
@Tag("VectorSearch")
5355
public class VectorSearchTests {
5456

5557
private static final String SCORE_FIELD = "vector-search-tests";

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/ReactiveVectorSearchTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.List;
2424

2525
import org.junit.jupiter.api.BeforeAll;
26+
import org.junit.jupiter.api.Tag;
2627
import org.junit.jupiter.api.Test;
2728

2829
import org.springframework.beans.factory.annotation.Autowired;
@@ -60,6 +61,7 @@
6061
*/
6162
@Testcontainers(disabledWithoutDocker = true)
6263
@SpringJUnitConfig(classes = { ReactiveVectorSearchTests.Config.class })
64+
@Tag("VectorSearch")
6365
public class ReactiveVectorSearchTests {
6466

6567
Vector VECTOR = Vector.of(0.2001f, 0.32345f, 0.43456f, 0.54567f, 0.65678f);

0 commit comments

Comments
 (0)