Files
nuzlocke-tracker/.beans/nuzlocke-tracker-ycfs--inject-test-data-into-dev-environment.md
Julian Tabel 78d31f2856 Add test data injection script with varied runs and encounters
Creates 6 runs across FireRed, Platinum, Emerald, HeartGold, Black, and
Crystal with mixed statuses (failed/completed/active), diverse encounter
states (caught/fainted/missed/evolved/dead), and varied rule configs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 20:35:59 +01:00

38 lines
1.7 KiB
Markdown

---
# nuzlocke-tracker-ycfs
title: Inject test data into dev environment
status: completed
type: task
priority: normal
created_at: 2026-02-06T09:48:38Z
updated_at: 2026-02-07T19:35:11Z
---
Create a script to populate the development database with realistic test data for manual testing.
## Requirements
- Multiple runs across different games with varied statuses:
- 2 failed runs (different games, progressed partway)
- 2 completed runs (different games, most routes visited)
- 2 active/in-progress runs (different games, early-to-mid progress)
- Each run should have a mix of encounter states:
- Caught (alive): with nicknames, catch levels
- Caught (dead): with faint_level, death_cause
- Fainted (failed to catch)
- Missed (ran away / KOd)
- Some caught Pokemon should be evolved (current_pokemon_id set via the evolutions table)
- Runs should use varied rule configurations (some with pinwheel clause off, some with hardcore mode, etc.)
- Respects the one-encounter-per-group constraint (only one child route per parent group gets an encounter, unless pinwheel zones apply)
## Implementation
- Add inject_test_data.py to backend/src/app/seeds/
- Follows the same async session pattern as run.py
- Queries DB for real game_ids, route_ids, pokemon_ids, and evolution chains so data is always valid
- Invocable via python -m app.seeds.inject_test_data (standalone entry block)
- Clears existing runs+encounters before injecting (idempotent)
- Prints summary of what was created
## Checklist
- [x] Create inject_test_data.py with test data injection logic
- [x] Wire up as standalone script (python -m app.seeds.inject_test_data)
- [x] Verify it runs cleanly against a seeded database