Skip to content

Add PHPUnit tests workflow for Doltlite#371

Draft
JanJakes wants to merge 1 commit into
trunkfrom
doltlite
Draft

Add PHPUnit tests workflow for Doltlite#371
JanJakes wants to merge 1 commit into
trunkfrom
doltlite

Conversation

@JanJakes

@JanJakes JanJakes commented Apr 24, 2026

Copy link
Copy Markdown
Member

Summary

Runs the mysql-on-sqlite PHPUnit suite against Doltlite, a SQLite fork whose storage engine is a content-addressed prolly tree. The suite passes with the same counts as the local Doltlite verification run: 714 tests, 1,428,233 assertions, 15 skipped, 2 incomplete.

The workflow builds Doltlite from source, swaps the system libsqlite3 for it so PHP's pdo_sqlite transparently resolves against Doltlite, verifies the swap took effect, and then runs PHPUnit without any filters. The swap replaces the earlier LD_PRELOAD approach; LD_PRELOAD loses to pdo_sqlite's DT_NEEDED binding on libsqlite3.so.0.

Doltlite currently has four deviations from stock SQLite that break the driver. Each one is addressed by a narrow source-level patch applied before build, paired with a one-shot verify assertion in the workflow that fails fast if the patch stops applying or stops fixing the behavior:

  1. Keep mysql-on-sqlite tables as rowid tables. Doltlite auto-converts ordinary composite/TEXT primary-key tables to WITHOUT ROWID, but the driver still relies on rowid access for table recreation, limited UPDATE/DELETE rewrites, on-update triggers, zero-column result statements, and metadata reads.

  2. Keep merge scans aligned across committed tree rows and transaction-local mutmap entries. Without this, a deleted committed tree entry can still be emitted, and a mutmap-only row can be followed by a stale committed tree row outside the seek prefix.

  3. Strip comments while canonicalizing schema SQL. Without this, rollback after a failed CHECK insert can collapse whitespace while preserving -- comments, leaving malformed CREATE TABLE SQL in sqlite_schema.

  4. Use the current cursor key for auxiliary index deletes. Without this, deletes through non-key predicates can leave stale unique index entries visible inside the transaction.

Doltlite upstream already includes the previous eqSeen preservation and lossy-collation payload fixes. The workflow still verifies those behaviors so we catch regressions.

The patches are CI-only. Upstreaming them to Doltlite is a separate task.

Test plan

  • PHPUnit Tests (Doltlite) runs green on this PR.
  • Full PR check suite is green on the squashed branch.
  • Local Docker verification against patched Doltlite: 714 tests, 1,428,233 assertions, 15 skipped, 2 incomplete.

@JanJakes JanJakes changed the title Try running PHPUnit tests against Doltlite Add PHPUnit tests workflow for Doltlite Apr 24, 2026
Run the mysql-on-sqlite PHPUnit suite against Doltlite by building https://github.com/dolthub/doltlite from source and installing its shared library as the libsqlite3 resolved by PHP's pdo_sqlite.

Keep the CI-only Doltlite compatibility patches in .github/doltlite-patches, with fast workflow reductions that verify each patched behavior before the full PHPUnit run.
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