Stabilize GameListPageTest fixture cleanup for persistent dev databases #358
Labels
No labels
automated
code-quality
component: admin dashboard
component: backend
component: billing
component: content management
component: faqs
component: game genres
component: game lists
component: game reviews
component: game search
component: games
component: internal notifications
component: platforms
component: security
component: tests
component: user api
component: user badges
component: user blogs
component: user consoles
component: user favorites
component: user friends
component: user notifications
component: user profiles
component: user site notifications
component: user wishlists
component: web design
dependencies
php
priority
high
priority
low
priority
medium
security-hotspot
source: codex
source: sonarqube
status
awaiting feedback
status
backlog
status
done
status
in progress
status
in queue
status
in review
status
needs codex review
status
needs investigation
status
wontfix
type: bug
type: documentation
type: feature
type: improvement
type: regression
type: task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MyVideoGameList/myvideogamelist.com#358
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While reviewing #350, the issue-specific list-edit tests passed in isolation, but the full
tests/Feature/GameListPageTest.phprun remained unreliable against the persistent MariaDB dev database.The failures are not about the #350 controller behavior directly. They point to the test file relying on fixed
240xxIDs and repeated fixture names while the test database can retain rows after interrupted or failed runs. That lets stale rows from prior runs affect later tests, producing unrelated 404s, unique-key collisions, or assertions against the wrong fixture state.Source: #350 review and local focused test run.
Scope
tests/Feature/GameListPageTest.phpfixture helpers and cleanup.24001..24150.Acceptance Criteria
GameListPageTestremoves stale fixture rows before each test even if a previous run failed midway.game_idrange path.240xxgame/platform IDs no longer collide after an interrupted previous run.php artisan test --compact tests/Feature/GameListPageTest.phpvendor/bin/pint --dirty --format agentpasses if PHP files are changed.Suggested Implementation Notes
cleanupGameListPageFixtures()aggressively remove:username like 'list-page-%';game_listsowned by those users;game_listswith fixturegame_idvalues in the file's reserved range;gamesandplatformsin the reserved fixture range;List Page Platform%.insertListPagePlatform()default to a unique name derived from the fixture ID.Test Coverage Required
GameListPageTestfile after intentionally starting from a database that may contain stale240xxfixture rows.Progress Checklist
GameListPageTestfixture isolation.GameListPageTestpasses.Implemented in
335e1fc(Harden game list page test fixtures).Notes:
cleanupGameListPageFixtures()now removes stalegame_listsboth bylist-page-%test users and by reserved24001..24150fixture game IDs before cleaning up reserved games/platforms/users.List Page Platform {id}; collision resistance comes from the broader before/after cleanup, including reserved platform IDs andList Page Platform%names.Alternative Titlesto the current singular presenter labelAlternative Title:for single-alias fixtures.Verification:
php artisan test --compact tests/Feature/GameListPageTest.php-> 37 passed, 385 assertions.vendor/bin/pint --format agent tests/Feature/GameListPageTest.phppassed. I used targeted Pint instead of literalvendor/bin/pint --dirtybecause this checkout already had unrelated dirty PHP files that were intentionally left untouched.Completed in
335e1fc. The GameListPageTest fixture cleanup now removes stale list-page users, reserved fixture game/list rows, and reserved/default-name platform fixtures; full GameListPageTest and #350 focused filters pass.