Skip to content

test(shop): add a pilotage schema integrity e2e (idempotence, unique keys, restore) - #48

Merged
Drago37 merged 1 commit into
developfrom
test/pilotage-schema-integrity
Sep 21, 2026
Merged

Drago37 merged 1 commit into
developfrom
test/pilotage-schema-integrity

Conversation

@Drago37

@Drago37 Drago37 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Third lot of #3 (test-secure the dashboard).

Adds an integration e2e — make e2e-pilotage-schema-local, auto-discovered by scripts/e2e-ci.sh so it runs in CI too — verifying, against the real PilotageSchemaManager:

  • migration idempotence (re-run without SQL error, all six tables present);
  • the sequence_number nullability fix (the documented dbDelta pitfall);
  • that the unique constraints (receipts.sequence_number, harvest_lots.code, stock_movements.reference_key) reject duplicates — a concurrency proxy;
  • a backup/restore round-trip.

Every check runs on CREATE TEMPORARY TABLE … LIKE copies, so no real data is touched and the temporary tables are dropped at the end.

Gates green: PHP-CS-Fixer, PHPStan (max), PHPUnit (346), new e2e (16 assertions).

Relates to #3

…keys, restore)

Third lot of issue #3 (test-secure the dashboard). Adds an integration
e2e — `make e2e-pilotage-schema-local`, auto-discovered by
scripts/e2e-ci.sh so it also runs in CI — that verifies, against the
real PilotageSchemaManager:

- migration idempotence (re-run without SQL error, all six tables
  present);
- the sequence_number nullability fix (the documented dbDelta pitfall);
- that the unique constraints (receipts.sequence_number,
  harvest_lots.code, stock_movements.reference_key) reject duplicates
  (a concurrency proxy);
- a backup/restore round-trip.

Every check runs on `CREATE TEMPORARY TABLE … LIKE` copies, so no real
data is touched, and the temp tables are dropped at the end. AGENTS
documents it next to the dbDelta pitfall.

Gates green: CS-Fixer, PHPStan (max), PHPUnit (346), new e2e (16
assertions).
@Drago37 Drago37 added the enhancement New feature or request label Sep 21, 2026
@Drago37 Drago37 self-assigned this Sep 21, 2026
@Drago37
Drago37 merged commit 05da3ac into develop Sep 21, 2026
6 checks passed
@Drago37
Drago37 deleted the test/pilotage-schema-integrity branch September 21, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant