Matched signals
- fixture not found
- missing fixture
- fixture file missing
- no such file or directory
- FileNotFoundError
- FactoryBot
- factory_bot
- factory not registered
Missing test fixture or seed data
What this failure means
A test failed because it could not load a required fixture file, seed record, or test helper resource that was expected to exist before the test ran.
Symptoms
Faultline looks for one or more of these log fragments:
fixture not found
missing fixture
fixture file missing
no such file or directory
FileNotFoundError
FactoryBot
factory_bot
factory not registered
Diagnosis
A test failed because it could not load a required fixture file, seed record, or test helper resource that was expected to exist before the test ran.
Fix steps
-
Run the database seed step before the test suite:
rails db:seed,npm run db:seed,python manage.py loaddata, or the project equivalent. -
Check if the fixture file was recently renamed or deleted:
git log --diff-filter=D --name-only --pretty=format: -- testdata/ fixtures/ | grep -v "^$" | head -20 -
Verify the fixture path is committed and not gitignored:
git ls-files testdata/ git ls-files fixtures/ -
For factory errors: confirm the factory definition matches the current model schema. Run pending migrations before seeding:
rails db:migrate,python manage.py migrate. -
Update the fixture file or factory definition to match the current data model, then re-run migrations and seeds before the test suite.
Validation
- Run the seed step locally and confirm it exits 0.
- Re-run the full test suite and confirm the fixture-not-found errors are gone.
Why it matters
Fixture errors occur when a fixture file is deleted or renamed without updating the tests that reference it, when a database migration removes a field or table that fixtures depend on, or when a CI environment starts without running the required seed step.
Prevention
- Include fixture setup in a shared test setup script that runs automatically.
- Add a CI lint step that validates all referenced fixture files exist.
- When migrating, update all fixtures and factories in the same PR.
- Keep seed data, factories, and schema changes versioned together so test setup does not drift behind the application model.
Try it locally
git ls-files testdata/
git ls-files fixtures/
git ls-files testdata/
How Faultline detects it
Use faultline explain missing-test-fixture to see the full playbook.
faultline analyze build.log
faultline explain missing-test-fixture
Generated from playbooks/bundled/log/test/missing-test-fixture.yaml. Do not edit directly.