Paradaux

PAR-242

0

Business IT harness: build schema from economy-flyway migrations, not a bundled schema.sql (CI red)

Pending ReleaseUnassignedBusinessBug

Problem

The Business · Test & Coverage workflow is failing on every push: its "Apply schema to MariaDB service" step runs mariadb … < business/src/main/resources/sql/schema.sql, but that snapshot was removed in the monorepo migration (No such file or directory). The embedded path is equally broken — MariadbContainerExtension.startEmbeddedDb() calls applySql("test-prelude.sql") + applySql("sql/schema.sql"), the latter not on the classpath (sql/schema.sql not on test classpath).

This is the same defect PAR-239 fixed for Treasury, never ported to Business. The bundled snapshot also duplicated the authoritative economy-flyway schema (drift risk).

Fix (mirror PAR-239)

  • MariadbContainerExtension runs the authoritative economy-flyway migrations with Flyway (classpath:db/migration) on the DataSource — embedded MariaDB4j locally, the MariaDB service container in CI. economy-flyway V1 already defines uuid_to_bin/bin_to_uuid, accounts, and every firm_* table the ITs use, so the test-prelude.sql stub (UUID helpers + stub accounts) is no longer needed.
  • business/build.gradle.kts adds flyway-core + flyway-mysql (test scope) and stages the economy-flyway migrations onto the test classpath via processTestResources.
  • business-test.yml drops the manual mariadb-client install + test-prelude.sql/schema.sql apply steps; the service container just provides an empty business_test DB. Pin the service to mariadb:10.11 to match Treasury + local MariaDB4j (avoids the MariaDB 11 flaky-trigger issue now that Business applies the same account_balances_mat triggers).
  • Delete the now-unused business/src/test/resources/test-prelude.sql.

Acceptance

  • Business · Test & Coverage is green: ITs build the schema via Flyway, run, and the 95% coverage gate passes.
  • No bundled schema.sql/test-prelude.sql; Business and prod share one schema source of truth.

Comments

No comments yet.

Activity

  • tesks changed status to Status → Pending Release
  • tesks created the issue