Use when E2E tests need a reproducible seed dataset and the project has none, or the existing seed has drifted. Picks a representative cross-section of users, orgs and data, generates rows with the project's factory library, checks in the fixture and wires it into test setup.
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
The seed runs the same factory script in every environment; only the
surrounding orchestration differs. Keep the seed command a single
named target (make seed) and call it from each environment.
# .github/workflows/e2e.yml (excerpt)
- name: Set up DB
run: |
bundle exec rake db:test:reset
bundle exec ruby scripts/seed.rb
- name: Run E2E tests
run: bundle exec rspec spec/systemReset between test suites - never share state across suites unless
the team explicitly designed for it (and accepted the flake risk;
see flake-pattern-reference Pattern 2).
# docker-compose.test.yml (excerpt)
services:
app:
build: .
depends_on:
db:
condition: service_healthy
command: |
sh -c "
rake db:migrate &&
ruby scripts/seed.rb &&
bundle exec rspec
"