Skip to content

test(db): replace addToAssertionCount checkbox tests in DB - #60750

Open
miaulalala wants to merge 1 commit into
masterfrom
fix/noid/checkbox-tests-db
Open

test(db): replace addToAssertionCount checkbox tests in DB#60750
miaulalala wants to merge 1 commit into
masterfrom
fix/noid/checkbox-tests-db

Conversation

@miaulalala

Copy link
Copy Markdown
Contributor

Summary

  • MigratorTest: add #[DoesNotPerformAssertions] to 5 tests that verify migrations run without throwing; refactor testInsertAfterUpgrade to use expectException instead of a try/catch checkbox; replace addToAssertionCount in testNotNullEmptyValuesFailOracle with a real assertion on the insert return value
  • QueryBuilderTest: remove two unreachable addToAssertionCount(1) calls from catch blocks in testGetLastInsertId (the fail() in each try block already handles the no-exception path)

Part of a broader effort to eliminate checkbox tests and replace them with proper PHPUnit 11 semantics.

Test plan

  • Run NOCOVERAGE=1 ./autotest.sh sqlite tests/lib/DB/MigratorTest.php
  • Run NOCOVERAGE=1 ./autotest.sh sqlite tests/lib/DB/QueryBuilder/QueryBuilderTest.php
  • Confirm no risky test warnings in CI

🤖 Generated with Claude Code

@miaulalala miaulalala self-assigned this May 26, 2026
@miaulalala miaulalala added 3. to review Waiting for reviews tests Related to tests CI labels May 26, 2026
@miaulalala miaulalala added this to the Nextcloud 35 milestone May 26, 2026
@miaulalala
miaulalala force-pushed the fix/noid/checkbox-tests-db branch from 5e1c6e2 to de80a8a Compare May 26, 2026 21:30
@miaulalala

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@miaulalala
miaulalala marked this pull request as ready for review May 27, 2026 16:31
@miaulalala
miaulalala requested a review from a team as a code owner May 27, 2026 16:31
@miaulalala
miaulalala requested review from ArtificialOwl, icewind1991, leftybournes and provokateurin and removed request for a team May 27, 2026 16:31
Comment thread tests/lib/DB/MigratorTest.php Outdated
Comment thread tests/lib/DB/QueryBuilder/QueryBuilderTest.php
…ormAssertions and real assertions

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@miaulalala
miaulalala force-pushed the fix/noid/checkbox-tests-db branch from de80a8a to f8e8cbf Compare June 24, 2026 11:05
@miaulalala
miaulalala requested a review from joshtrichards June 24, 2026 11:12
This was referenced Aug 12, 2026
@nextcloud-bot nextcloud-bot mentioned this pull request Aug 20, 2026
@skjnldsv skjnldsv mentioned this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants