You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@StormTest runs on H2. The url() attribute takes a raw JDBC string, so pointing a test class at PostgreSQL means standing up the container, wiring the lifecycle and building the URL by hand, per project.
That leaves the first test a new user writes running on the one dialect Storm supports that hides the most. 1.14 was largely about SQL that is correct on every dialect rather than on the permissive ones, and the differences it dealt with are exactly the ones H2 papers over: upsert paths, sequence discovery, identity grouping, keyword escaping. A green H2 suite is not evidence the application works.
Proposal
A database attribute that resolves a container instead of a URL:
@StormTest(database = POSTGRES, scripts = {"/schema.sql", "/data.sql"})
classVisitRepositoryTest {
@TestvoidfindsVisitsByPet(ORMTemplateorm) {
// running against a real PostgreSQL
}
}
Testcontainers stays optional. storm-test declares it provided; the attribute fails with a message naming the missing dependency rather than a NoClassDefFoundError, and H2 users pull nothing new.
Containers are reused across test classes in a run, keyed by database and version, so the cost is paid once rather than per class.
The image tag is settable on the annotation and defaults to a pinned version, not latest.
Per-test rollback (Per-test rollback for @StormTest #387) applies unchanged, which is what makes container reuse safe: classes share a container and still never observe each other's writes.
url() keeps working for anyone pointing at their own database.
Also on the slice
@DataStormTest (#200, #401) should take the same attribute, for the same reason. A Spring slice that can only run on H2 has the same blind spot.
Notes
The reactor already runs five dialects on Testcontainers in storm-postgresql, storm-mysql, storm-mariadb, storm-mssqlserver and storm-oracle. This makes that wiring a supported annotation attribute instead of per-project boilerplate.
Script execution, parameter injection and SqlCapture are dialect-independent and should need no changes.
Tasks
database attribute on @StormTest, resolved through Testcontainers, with a pinned default image tag
Testcontainers as a provided dependency, with a clear failure when the attribute is used without it
Container reuse across test classes within a run, keyed by database and version
@StormTestruns on H2. Theurl()attribute takes a raw JDBC string, so pointing a test class at PostgreSQL means standing up the container, wiring the lifecycle and building the URL by hand, per project.That leaves the first test a new user writes running on the one dialect Storm supports that hides the most. 1.14 was largely about SQL that is correct on every dialect rather than on the permissive ones, and the differences it dealt with are exactly the ones H2 papers over: upsert paths, sequence discovery, identity grouping, keyword escaping. A green H2 suite is not evidence the application works.
Proposal
A
databaseattribute that resolves a container instead of a URL:storm-testdeclares itprovided; the attribute fails with a message naming the missing dependency rather than aNoClassDefFoundError, and H2 users pull nothing new.latest.url()keeps working for anyone pointing at their own database.Also on the slice
@DataStormTest(#200, #401) should take the same attribute, for the same reason. A Spring slice that can only run on H2 has the same blind spot.Notes
storm-postgresql,storm-mysql,storm-mariadb,storm-mssqlserverandstorm-oracle. This makes that wiring a supported annotation attribute instead of per-project boilerplate.SqlCaptureare dialect-independent and should need no changes.Tasks
databaseattribute on@StormTest, resolved through Testcontainers, with a pinned default image tagprovideddependency, with a clear failure when the attribute is used without it@DataStormTest