Skip to content

Test Data Seed Script#55

Merged
calebyhan merged 1 commit intomainfrom
43/test-data
Mar 24, 2026
Merged

Test Data Seed Script#55
calebyhan merged 1 commit intomainfrom
43/test-data

Conversation

@calebyhan
Copy link
Copy Markdown
Contributor

Both backend integration tests and frontend development need realistic sample data. A seed script provides consistent, repeatable test data that makes development and demos easier.

Changes:

  • Added seed_data.py
    • Seeds realistic UNC sample data across all major tables
    • Idempotent (safe to rerun)
    • Covers: admin, districts, senators, leadership, committees, news, legislation/actions, events, carousel, finance hearings, staff, static pages, budget, app config
  • Updated reset_dev.py
    • Now uses run_seed() instead of placeholder logic
  • Updated README.md
    • Added seeding commands:
      • python -m script.seed_data (idempotent reseed)
      • python -m script.reset_dev (drop/recreate + reseed)
  • Removed mock news fallback
    • api.ts now always uses backend (except 404 handling)
  • Integrated committees API
    • Updated committees.ts to fetch from /api/committees
    • Added backend → frontend data mapping
  • Removed obsolete mocks
    • Deleted frontend/src/lib/mock/news.ts
  • Fixed prerender issues when backend is offline
    • Enabled dynamic rendering for backend-dependent pages:
      • app/page.tsx
      • app/news/[id]/page.tsx
      • app/committees/[id]/page.tsx

Closes #43

@github-actions
Copy link
Copy Markdown

Test Results

352 tests  ±0   352 ✅ ±0   2s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit c257a31. ± Comparison against base commit 967f14f.

Copy link
Copy Markdown
Collaborator

@MasonMines2006 MasonMines2006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@calebyhan calebyhan merged commit 945f5d7 into main Mar 24, 2026
3 checks passed
@calebyhan calebyhan deleted the 43/test-data branch March 24, 2026 14:41
@MasonMines2006
Copy link
Copy Markdown
Collaborator

I had to google what LGTM means lol

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.

Test Data Seed Script

2 participants