Skip to content

fix(tests): keep the standalone Doctrine and Symfony stubs out of the CI bootstrap - #1409

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/unit-stubs-out-of-ci-glob
Nov 3, 2026
Merged

rubenvdlinde merged 1 commit into
developmentfrom
fix/unit-stubs-out-of-ci-glob

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Why development is red

Run 41651793568 (on #1402's head, which includes #1400) fails every PHPUnit cell with 6 errors. Each one is a missing OCA\OpenRegister\Event\ObjectCreatingEvent or ObjectUpdatedEvent. Those classes exist in OpenRegister. The log shows the cause first:

[stackiq/tests/bootstrap] Nextcloud at .../server could not finish booting (Call to undefined method Doctrine\DBAL\Query\Expression\ExpressionBuilder::eq()).

#1400 (commit 7ec46a1) added tests/Stubs/Doctrine/*.php and tests/Stubs/Symfony/HeaderUtils.php one directory deep. CI runs phpunit.xml, whose tests/bootstrap.php requires every file matching tests/Stubs/{,**/}*.php before Nextcloud boots. So the stub ExpressionBuilder (it has no eq()) took the place of Doctrine's, the server could not finish booting, and OpenRegister never loaded.

The fix

  • The stubs move to tests/Stubs/Standalone/, two levels deep, where the glob does not reach. The Integriq and OpenRegister event stubs use the same placement.
  • tests/bootstrap-stubs.php (outside tests/Stubs/) loads each stub only when the real class is absent. bootstrap-unit.php requires it where the inline block used to be. bootstrap.php requires it after the boot, so a run without a server still finds the stubs.

Verified locally

  • Glob probe: on development the CI glob loads the 5 Doctrine/Symfony stubs; on this branch it loads none of them.
  • Boot probe: I ran the glob, then the server's 3rdparty/autoload.php, then resolved ExpressionBuilder. On development that gives tests/Stubs/Doctrine/ExpressionBuilder.php with eq()=NO, which is exactly the CI error. On this branch it gives 3rdparty/doctrine/dbal/.../ExpressionBuilder.php with eq()=yes.
  • The 7 unit test files that use the Doctrine or HeaderUtils stubs pass under phpunit-unit.xml.
  • Full unit suite on the merged tree (development at ea0dcc2 plus this fix), phpunit-unit.xml under pcov with --fail-on-risky, run once through heavy.sh: exit 0, 1572 tests, 16364 assertions, 0 failures, 0 risky, 59 skipped (the skips are inherited and untouched).
  • Not runnable locally: phpunit.xml without a booted server stops at OCP\Migration\IRepairStep not found, on development as well, because it needs the server. CI is the place where that config runs.

Only test bootstrap files change. No production code is touched.

Assisted-by: ClaudeCode:claude-opus-5-5

… CI bootstrap

#1400 put the Doctrine and HeaderUtils stubs one directory below tests/Stubs.
tests/bootstrap.php, the bootstrap CI runs, loads every file that deep before
Nextcloud boots, so the stub ExpressionBuilder (without eq()) replaced
Doctrine's. The server then could not finish booting, OpenRegister never
loaded, and every PHPUnit cell failed on its missing event classes.

The stubs move to tests/Stubs/Standalone/, out of that glob's reach, and
tests/bootstrap-stubs.php loads each one only when the real class is absent.
bootstrap-unit.php requires it as before; bootstrap.php requires it after the
boot, so a run without a server still finds them.

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde marked this pull request as ready for review November 3, 2026 17:23
@rubenvdlinde
rubenvdlinde merged commit 331e86f into development Nov 3, 2026
8 checks passed
@rubenvdlinde

Copy link
Copy Markdown
Contributor Author

Hydra gates (--scope-to-diff --base origin/development, through heavy.sh): 24 of 24 applicable gates ran, 0 FAIL.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/stackiq @ 8fbc967

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
check-vue-demi ✅
test-l10n ✅
format ✅
check-schema-l10n ❌
check-l10n-js ✅
composer ✅ ✅ 127/127
npm ❌ ✅ 807/807
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ✅ 1552/1552 · 20 skipped
Newman ⏭️
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-03 20:17 UTC

Download the full PDF report from the workflow artifacts.

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