2026-02-06 11:20:15 +01:00
|
|
|
---
|
|
|
|
|
# nuzlocke-tracker-ycfs
|
|
|
|
|
title: Inject test data into dev environment
|
2026-02-07 20:35:59 +01:00
|
|
|
status: completed
|
2026-02-06 11:20:15 +01:00
|
|
|
type: task
|
2026-02-07 20:35:59 +01:00
|
|
|
priority: normal
|
2026-02-06 11:20:15 +01:00
|
|
|
created_at: 2026-02-06T09:48:38Z
|
2026-02-07 20:35:59 +01:00
|
|
|
updated_at: 2026-02-07T19:35:11Z
|
2026-02-06 11:20:15 +01:00
|
|
|
---
|
|
|
|
|
|
2026-02-07 20:35:59 +01:00
|
|
|
Create a script to populate the development database with realistic test data for manual testing.
|
2026-02-06 11:20:15 +01:00
|
|
|
|
2026-02-07 20:35:59 +01:00
|
|
|
## 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)
|
2026-02-06 11:20:15 +01:00
|
|
|
|
2026-02-07 20:35:59 +01:00
|
|
|
## 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
|