Skip to content

ci: test the databases with Pest, E2E on MySQL - #117

Merged
LukeSavefrogs merged 7 commits into
mainfrom
claude/gifted-euler-rmm07v
Nov 27, 2026
Merged

LukeSavefrogs merged 7 commits into
mainfrom
claude/gifted-euler-rmm07v

Conversation

@LukeSavefrogs

@LukeSavefrogs LukeSavefrogs commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Database bugs come from the query layer (raw SQL, JSON operators, migrations, prefixes), and the Pest suite covers that faster and more precisely than running all ~237 browser tests on every database. This PR moves the database matrix to Pest:

  • E2E tests (run-e2e-tests.yml): one job with three include entries:
    • E2E all runs every Playwright project except the setup wizard, on MySQL only (the database used in production and by the PR previews). Its list of projects is spelled out, and a comment in playwright.config.ts says to add new projects there too.
    • E2E setup wizard (sqlite|mysql) runs only --project=setup-wizard, because the wizard configures the database of its own run.
    • Together they cover all 237 tests exactly once (231 + 6, checked with playwright test --list). Local runs still default to SQLite.
  • Pest tests (run-pest-tests.yml): Sail is gone. The suite runs directly on the runner with a database service container. The matrix is database × db-prefix: MySQL 8.0 and SQLite, each without a prefix and with the p9999_ prefix.
    • Coverage (pcov) is measured once, on MySQL without a prefix, and only over app/ (the <source> of phpunit.xml).
    • SQLite uses a file (database/testing.sqlite), as a real install does. An in-memory database is lost when db:wipe disconnects from it (SharedDatabaseSafetyTest).
    • Adding pgsql or mariadb later means adding it to database, plus an include entry (image, port, user) and its PHP extension.
    • Trade-off: CI no longer builds the Sail image.
  • Test fix: RootUserTransferTest "other errors reading the root user setting are raised" now makes the settings query fail the same way on every database. SQLite reads an unknown quoted column as a string, so pointing the settings at the users table raised no error there.
  • Docs:
    • README.md (End-to-end tests) and .github/copilot-instructions.md (list of workflows).
    • The unreleased CHANGELOG.md entry of test: add a Playwright E2E suite #116 said the E2E tests run on SQLite and MySQL. It now describes the new split and links this PR.

Required checks (branch protection on main, already updated)

Old New
Pest (prefixed=no) Pest (mysql, prefixed=no)
Pest (prefixed=yes) Pest (mysql, prefixed=yes)
— Pest (sqlite, prefixed=no) (added)
— Pest (sqlite, prefixed=yes) (added)
E2E (mysql) E2E all
E2E (sqlite) removed
— E2E setup wizard (sqlite) (added)
— E2E setup wizard (mysql) (added)

🤖 Generated with Claude Code

https://claude.ai/code/session_019ELFCv5TybakcWoMz8SmQN

Run Pest on the runner with a database service instead of Sail, one
matrix entry per database: MySQL with and without a prefix, and SQLite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The database support is tested by Pest: run the browser tests once on
MySQL, and only the setup wizard on each database.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LukeSavefrogs LukeSavefrogs added the preview: off No preview for this PR label Nov 27, 2026 — with Claude
An in-memory database is lost when db:wipe disconnects from it, and the
setup wizard tests need a DB_USERNAME to fall back to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SQLite reads an unknown quoted column as a string, so pointing the
settings at another table raised no error there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every database runs with and without the longest table prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LukeSavefrogs
LukeSavefrogs merged commit a199e08 into main Nov 27, 2026
13 checks passed
@LukeSavefrogs
LukeSavefrogs deleted the claude/gifted-euler-rmm07v branch November 27, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview: off No preview for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants