Skip to content

test(jdbc): add Flyway integration smoke tests - #259

Merged
magnusp merged 3 commits into
mainfrom
feat/flyway-itests
Oct 30, 2026
Merged

magnusp merged 3 commits into
mainfrom
feat/flyway-itests

Conversation

@magnusp

@magnusp magnusp commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Promotes the Flyway smoke prototype into libsql-jdbc as a Failsafe integration test.

  • FlywayMigrationIT drives the in-tree driver through Flyway 13.12: versioned and repeatable migrations, multi-statement scripts, the schema history table, idempotent re-migrate, DDL rollback on a failed migration, baseline, a jdbc:sqlite: alias with a DataSource, and URL configuration with an explicit driver class.
  • FlywaySqldSupport starts the pinned sqld Testcontainer and provides a DataSource plus reset helpers. Flyway owns the schema here, so there is no out-of-band bootstrap.
  • FlywayKnownGapsIT pins four Flyway/driver-facing limitations:
    • jdbc:libsql: is not recognized by Flyway's SQLite plugin;
    • a jdbc:sqlite: URL cannot select the libSQL driver through dataSource(url, ...) (Flyway 13.12 builds its DriverDataSource eagerly with a null driver class and falls back to org.sqlite.JDBC);
    • flyway.clean() is rejected because sqld enables foreign keys and Flyway sends PRAGMA foreign_keys = OFF; DROP TABLE ...; PRAGMA foreign_keys = ON as one string. Decision: support clean(); the mechanism is deferred to refinement in Keep a connection-scoped Hrana stream for auto-commit: fix last_insert_rowid() and Flyway clean() #258.
    • auto-commit statements do not share session state, so PRAGMA-based connection tuning does not survive.
  • Test-only dependencies: Flyway 13.12.0, Testcontainers, and Failsafe *IT wiring. mvn test stays unit-only.
  • The module copies the shared Docker config into target/docker-config and sets DOCKER_CONFIG for Failsafe, so sandboxed runs work without a shell override.

Test plan

  • ./mvnw -pl libsql-jdbc -am verify — 12 Flyway tests pass (7 migration, 5 gap pins)
  • ./prototype/flyway-smoke/run.sh — 11 prototype tests pass against a throwaway sqld container
  • ./mvnw spotless:check

Follow-up

Refs #258, #263.

@magnusp
magnusp force-pushed the feat/flyway-itests branch from 5926510 to 3d14c31 Compare October 30, 2026 23:23
# Conflicts:
#	libsql-jdbc/pom.xml
#	pom.xml
# Conflicts:
#	libsql-jdbc/pom.xml
#	pom.xml
@magnusp
magnusp merged commit 08a3531 into main Oct 30, 2026
6 checks passed
@magnusp
magnusp deleted the feat/flyway-itests branch October 30, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant