The suite ran on in-memory SQLite, an engine production never uses: it hid
column lengths, MySQL-only syntax and type coercion (the identity bug fixed in
the previous commit passed CI that way). SQLite is gone:
- TestDb connects only to MariaDB/MySQL (XCVM_TEST_DB_DSN/_USER/_PASS; root over
the local socket, else 127.0.0.1:3306). Each instance gets a throwaway
schema, dropped with it, in the installer's sql_mode, with an explicit
connect timeout (a boot under test can zero default_socket_timeout).
- InstallSchema and the tests take the production DDL as is: the SQLite
reducers, the keys they re-added, the faked information_schema and the
sqliteCreateFunction() stand-ins are removed; test DDL is MySQL DDL.
- ReplicaBootTest, DbConnectRefusalTest and LazyDatabaseHandlerTest reach the
test server instead of SQLite files; RecordingFinalizer no longer swallows
an information_schema failure "for tests on SQLite".
- `make test-db` starts a throwaway mariadb:11.4 (tmpfs) for a machine without
a server; the CI PHPUnit job gets the same as a service.
The suite also runs on a panel host with the bundled PHP and its own php.ini:
tests reach the code through MAIN_HOME, not `<repo>/src`; repository checks
and process-isolated tests (ionCube Loader + OPcache CLI segfault on a script
read from stdin) are in the skip-on-panel group; xcvm_test_child_php() starts
a child that fakes \XC_VM without the real extension; Redis-down tests use
RedisManager::useConnector() instead of an eval'd \XC_VM.
Stale opt-in tests fixed on the way: the real-agent provisioning test answers
the agent-started check, the extension integration test sends the typed starts
and reads the binary signature raw, a fake producer starts as PHP_BINARY, and
the certbot test waits for the line its background command writes.
A node's replica now owns the servers cache and the crontab's jobs only
once an authoritative apply has built them (a `replica_owned` record in
tmp/cache), not as soon as the agent has stored the sections. A refused
section, and CONFIG turned off, hand the caches back to MAIN's database.
cron:cache applies the replica from disk every minute while CONFIG is on,
and getAll() rebuilds a missing owned cache from disk and never writes
the database's rows over one. A database copy with frozen liveness can no
longer pass for the replica's, and an old crontab is not reused after
CONFIG was off.
- Both crontab readers write ReplicaApply::crontabText, which is tested.
- The crontab section leaves out rows a node would refuse and audits them
once. cronJob() anchors with \z, so a trailing newline is refused.
- Migration 043 gives the plan's MAIN-only crons the role main (maxmind
stays all), so the section sends no job the LB build strips.
- config.changed goes only to agents that say config_changed at hello,
each node on its own; a clone quarantine announces it too.
- The ETag cache's generation is a random token, so racing bumps differ.
- cron:certbot reads its own certbot_ssl from its row; service runs the
boot apply only on a CONFIG node, with a 15 s timeout.
- Tests for the review's surviving mutations, test isolation fixes, and
the ADR, the plan and the agent contract brought in line.
Admin-API boot runs ResellerAPI::init() on the login page (pre-auth), where the
$rPermissions global is still null. It passes that null straight into
ServerRepository::getStreamingSimple()/getProxySimple(), whose strict
`array $rPermissions` hint turned it into a fatal TypeError at boot:
ServerRepository::getStreamingSimple(): Argument #1 ($rPermissions) must be of
type array, null given, called in .../ResellerAPI.php on line 72
Both methods only read $rPermissions via isset($rPermissions['is_reseller']), so
null is functionally equivalent to "no reseller restriction". Make the param
`?array $rPermissions = null` on both (restoring pre-typing tolerance) rather
than patching all ~28 call sites that feed the global. The strict `array` type
stays on every other repository method that runs post-auth with a real array.
Add ServerRepositorySimpleTest as a regression (null perms, online filter,
reseller name masking, proxy list) against the SQLite TestDb.