spring-data-relational icon indicating copy to clipboard operation
spring-data-relational copied to clipboard

Unify integration test infrastructure

Open schauder opened this issue 3 years ago • 2 comments

Spring Data JDBC & R2DBC currently use different ways to implement integration tests.

JDBC

  • creates an ApplicationContext and uses Spring profiles to create the right kind of database.
  • SQL scripts are loaded from a text file which is derived from the test name and the database type.
  • runs integration tests against various different databases by running them with different Spring profiles.
  • has annotations to run tests based on the presence of a feature.

R2DBC

  • creates no ApplicationContext if doesn't need to for other reasons.
  • runs integration tests against various different databases by having subclasses for each database.

We should unify the test infrastructure and extract it into a test module which can be used by both modules.

schauder avatar Feb 21 '22 14:02 schauder

The practical effect of this issue is that https://github.com/spring-projects/spring-data-relational?tab=readme-ov-file#building-from-source is inaccurate/broken because, without other setup, ./mvnw clean install will fail once it gets to failsafe:integration-test plugin invocation in the default-test phase of spring-data-r2dbc.

Which for me means, that I'd like to test some changes to potentially contribute but can't really make sure it doesn't break some r2dbc unit test.

Xiphoseer avatar Jul 26 '24 15:07 Xiphoseer

@Xiphoseer I don't really see, how the described behaviour from you comment is caused by the different ways of handling integration tests for jdbc and r2dbc.

What failure are you seeing exactly? Is it complaining about a missing Docker environment? Or something else? You might consider creating a separate issue for this.

schauder avatar Aug 02 '24 07:08 schauder