Generate deterministic datasets — same seed, same output, every run, every machine. For test fixtures, CI pipelines, or shared staging data.
Guides · Quick start · Determinism · Configs · CLI reference
- The problem
- Basic usage
- Config files
- Multi-table fixtures
- Cross-language parity
- Fingerprint guard
- Validation in CI
- GitHub Actions
- Tips
faker.js, Faker, and similar libraries generate random data by default. Tests that depend on random values break unpredictably: snapshot mismatches, flaky assertions, CI reruns that waste time. Pinning a numeric seed helps until the library updates its algorithm and every fixture changes.
seedfaker with --seed produces byte-identical output across runs, machines, and languages. A fingerprint guard catches algorithm changes between versions.
seedfaker name email --seed ci-2026 --until 2026 -n 100 --format csv > test/fixtures/users.csvRun it twice. Diff the output. Zero differences.
name,email
Tariq bin Saif Al Osaimi,echeverriamartina@entelchile.net
Martina De la Cruz Flores,flor.coelho@tap.pt
Bu Fangyi,luzlozano@hey.com
...
For fixtures with multiple columns, modifiers, or expressions, use a YAML config:
columns:
id: serial
name: name
email: email
role: enum:admin=1,user=9
options:
seed: ci-2026
until: 2026
count: 100
format: csvseedfaker run fixtures.yaml > test/fixtures/users.csvDefine multiple tables in one config and generate all at once:
options:
seed: ci-2026
until: "2026"
format: csv
users:
columns:
id: serial
name: name
email: email
options:
count: 100
orders:
columns:
id: serial
user_id: users.id
user_name: user_id->name
amount: amount:plain:1..5000
options:
count: 500seedfaker run fixtures.yaml --all --output-dir test/fixtures/This writes test/fixtures/users.csv and test/fixtures/orders.csv.
The same seed produces identical values in Python and Node.js tests:
from seedfaker import SeedFaker
rows = SeedFaker(seed="ci-2026", until="2026").records(["name", "email"], 10)const { SeedFaker } = require("@opendsr/seedfaker");
const rows = new SeedFaker({ seed: "ci-2026", until: "2026" })
.records(["name", "email"], { n: 10 });Both produce the same 10 rows.
seedfaker includes a stable algorithm fingerprint. Pin it in your config to detect algorithm changes between versions:
columns:
name: name
email: email
options:
seed: ci-2026
until: 2026
count: 50
format: csv
fingerprint: sf0-a1b2c3d4Mismatch = immediate failure, not silent drift.
Current fingerprint:
seedfaker --fingerprintsf0-158dc9f79ce46b43
Check config syntax and field names without generating data:
seedfaker run fixtures.yaml --validateNo output on success, exit code 0.
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install seedfaker
run: cargo install seedfaker
- name: Validate fixture config
run: seedfaker run fixtures.yaml --all --output-dir test/fixtures/ --validate
- name: Generate fixtures
run: seedfaker run fixtures.yaml --all --output-dir test/fixtures/
- name: Run tests
run: make testAlways pin --until — without it, temporal fields use current time and fixtures differ across days:
seedfaker name timestamp --seed ci --until 2026 -n 10 # stable foreverAdd a Makefile target for regeneration:
fixtures:
seedfaker run fixtures.yaml --all --output-dir test/fixtures/