Skip to content

[TASK] Run the functional tests on SQLite - #1663

Merged
benjaminkott merged 1 commit into
masterfrom
task/functional-tests-on-sqlite-in-ci
Sep 9, 2026
Merged

benjaminkott merged 1 commit into
masterfrom
task/functional-tests-on-sqlite-in-ci

Conversation

@benjaminkott

@benjaminkott benjaminkott commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

Description

The functional tests run on SQLite. The mysql:8.0 service is gone
from the CI and the typo3Database* variables are gone from the DDEV
container.

The driver is declared in Build/phpunit-functional.xml, not in the CI
job, so a local checkout and the CI run the suite the same way and
neither carries database settings.

The service was started in all eight matrix jobs while only the two
8.5 ones actually run the functional tests — every other job paid for
a database it never touched. SQLite needs no service at all.

Nothing but the testing framework ever read the four typo3Database*
variables: the development instance takes its connection from the DDEV
generated config/system/additional.php, which points at db/db,
not at the t3func/root those variables described. Running the suite
against MySQL is still possible, it just means setting
typo3DatabaseDriver and the connection variables yourself; AGENTS.md
says so.

It is also faster. Measured locally on the full suite (72 tests, PHP
8.5, MySQL 8.0 in a neighbouring container):

Driver Time
MySQL 8.0 154 s
pdo_sqlite 92 s

Same 72 tests, same 378 assertions on both. The gain is setup, not
queries: with SQLite the testing framework builds the schema once per
test case and copies the empty database file for every following test
instead of truncating tables. In the CI the functional jobs went from
5m12s and 6m05s to 3m32s and 4m25s, and the six jobs that run no
functional tests from around a minute to half of that.

The trade off is that the CI no longer exercises MySQL. The package
reaches the database through TCA, QueryBuilder and DataHandler; after
#1661 there is no hand written SQL left in the tests.

Type of change

  • Bugfix
  • Task
  • Feature
  • Documentation

Related issues

Builds on #1661, which removed the last MySQL specific SQL from the
test suite.

How to validate

  1. The CI run on this pull request — the functional jobs are green
    without a database service.
  2. Nothing reaches MySQL any more, with the DDEV database deliberately
    out of reach:
    ddev exec bash -c 'typo3DatabaseHost=doesnotexist .build/bin/phpunit -c Build/phpunit-functional.xml'
    — 72 tests, 378 assertions, green.
  3. And with the variables gone rather than wrong:
    ddev exec bash -c 'unset typo3DatabaseHost typo3DatabaseName typo3DatabaseUsername typo3DatabasePassword; .build/bin/phpunit -c Build/phpunit-functional.xml'
    — same result.
  4. The override still works: run 2 with typo3DatabaseDriver=mysqli
    prepended fails on the unreachable host.

A ddev restart is needed for the container to drop the variables.

AI assistance

  • Agent and version: Claude Code, VS Code extension
  • Model and effort/reasoning level: Claude Opus 5 (1M context), default
    effort
  • Share written by the agent: the whole change and this description
  • Reviewed and understood before pushing: not yet — opened on request,
    review pending

Checklist

  • Targets master
  • Commits are signed off (git commit -s)
  • Commit subjects follow [BUGFIX|TASK|FEATURE] Subject
  • composer cgl leaves the code unchanged — no PHP touched
  • composer phpstan passes — no PHP touched
  • composer test passes
  • A bugfix comes with a test that fails without it — not
    applicable
  • Holds on every TYPO3 and PHP version declared in composer.json
    — the CI matrix itself is unchanged
  • Assets rebuilt — not applicable
  • Documentation updated — AGENTS.md; Documentation/ says
    nothing about the test database

@benjaminkott
benjaminkott force-pushed the task/functional-tests-on-sqlite-in-ci branch from 231b698 to 8a174cf Compare September 9, 2026 08:51
The functional suite declares `pdo_sqlite` itself, so a checkout and
the CI agree without either of them carrying database settings. The
MySQL service was started in all eight matrix jobs while only two of
them run the functional tests; SQLite needs no service at all and the
suite is faster on it, because the testing framework copies an empty
database file per test case instead of truncating tables.

Nothing but the testing framework ever read the `typo3Database*`
variables the DDEV container exported — the development instance takes
its connection from the DDEV generated `additional.php` — so they go
with it.

Signed-off-by: Benjamin Kott <benjamin.kott@outlook.com>
@benjaminkott
benjaminkott force-pushed the task/functional-tests-on-sqlite-in-ci branch from 8a174cf to 8417309 Compare September 9, 2026 09:01
@benjaminkott
benjaminkott merged commit 76f079a into master Sep 9, 2026
10 checks passed
@benjaminkott
benjaminkott deleted the task/functional-tests-on-sqlite-in-ci branch September 9, 2026 09:08
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