Browse Source

Disable `VectorSearch` tests on CI.

Running the VectorSearch tests is flakey on our CI as the container sometimes doesn't start.

Closes #5119
pull/4999/merge
Mark Paluch 1 week ago
parent
commit
0d1a5d9f9d
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 4
      Jenkinsfile
  2. 20
      spring-data-mongodb/pom.xml
  3. 2
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/VectorSearchTests.java
  4. 2
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/ReactiveVectorSearchTests.java

4
Jenkinsfile vendored

@ -83,7 +83,7 @@ pipeline {
docker.image("springci/spring-data-with-mongodb-8.0:${p['java.main.tag']}").inside(p['docker.java.inside.docker']) { docker.image("springci/spring-data-with-mongodb-8.0:${p['java.main.tag']}").inside(p['docker.java.inside.docker']) {
sh 'ci/start-replica.sh' sh 'ci/start-replica.sh'
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
"./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" "./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"
} }
} }
} }
@ -115,7 +115,7 @@ pipeline {
docker.image("springci/spring-data-with-mongodb-8.0:${p['java.next.tag']}").inside(p['docker.java.inside.docker']) { docker.image("springci/spring-data-with-mongodb-8.0:${p['java.next.tag']}").inside(p['docker.java.inside.docker']) {
sh 'ci/start-replica.sh' sh 'ci/start-replica.sh'
sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' +
"./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" "./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"
} }
} }
} }

20
spring-data-mongodb/pom.xml

@ -366,6 +366,25 @@
</dependencies> </dependencies>
<profiles> <profiles>
<profile>
<id>no-vector-search-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes combine.children="append">
<exclude>**/VectorIndexIntegrationTests.java</exclude>
<exclude>**/VectorSearchTests.java</exclude>
<exclude>**/ReactiveVectorSearchTests.java</exclude>
<exclude>**/MongoRepositoryContributorTests.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>nullaway</id> <id>nullaway</id>
<build> <build>
@ -506,4 +525,5 @@
</plugins> </plugins>
</build> </build>
</project> </project>

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

@ -25,6 +25,7 @@ import org.bson.BinaryVector;
import org.bson.Document; import org.bson.Document;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.MethodSource;
@ -50,6 +51,7 @@ import com.mongodb.client.MongoClients;
* @author Mark Paluch * @author Mark Paluch
*/ */
@Testcontainers(disabledWithoutDocker = true) @Testcontainers(disabledWithoutDocker = true)
@Tag("VectorSearch")
public class VectorSearchTests { public class VectorSearchTests {
private static final String SCORE_FIELD = "vector-search-tests"; private static final String SCORE_FIELD = "vector-search-tests";

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

@ -23,6 +23,7 @@ import reactor.test.StepVerifier;
import java.util.List; import java.util.List;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -60,6 +61,7 @@ import com.mongodb.client.MongoClients;
*/ */
@Testcontainers(disabledWithoutDocker = true) @Testcontainers(disabledWithoutDocker = true)
@SpringJUnitConfig(classes = { ReactiveVectorSearchTests.Config.class }) @SpringJUnitConfig(classes = { ReactiveVectorSearchTests.Config.class })
@Tag("VectorSearch")
public class ReactiveVectorSearchTests { public class ReactiveVectorSearchTests {
Vector VECTOR = Vector.of(0.2001f, 0.32345f, 0.43456f, 0.54567f, 0.65678f); Vector VECTOR = Vector.of(0.2001f, 0.32345f, 0.43456f, 0.54567f, 0.65678f);

Loading…
Cancel
Save