# go-testfixtures/testfixtures

Ruby on Rails like test fixtures for Go. Write tests against a real database

Repository: https://github.com/go-testfixtures/testfixtures
Canonical: https://ross.abutalabs.com/products/testfixtures
Homepage: https://pkg.go.dev/github.com/go-testfixtures/testfixtures/v3?tab=doc
Language: Go
License: MIT
License Family: permissive
Topics: go, testing, database, fixtures
Last push: 2026-08-19T05:49:38+00:00

## Health v2 (maintenance only)
Score: 78/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 41, longevity 100
- inputs: {"age_days": 3802, "days_push": 14, "days_rel": 313, "gap_med": 53.5, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1235, forks 92 (observed 2026-08-28T04:04:04.962532+00:00)

## What it is
A Go library that mimics Ruby on Rails-style test fixtures, loading YAML fixture files into a real SQL database before each test. It wipes and repopulates the test database so functional tests run against actual data instead of mocks.

## Use cases
- load yaml fixtures into a test database in go
- run go tests against a real database instead of mocks
- reset database state before each go test
- seed test data for functional tests in go
- rails-like fixtures for golang
- test go web apps with a real sql database

## When to choose
- you write Go integration or functional tests that hit a real SQL database
- you want Rails-style YAML fixtures with automatic per-test database reset
- you find database mocks tedious and error-prone

## When to avoid
- you only need unit tests with mocked data layers
- you cannot risk wiping a database (it deletes all data before loading)
- you use a non-SQL datastore

## Facets
- artifact type: library
- maturity: active
- function: testing, database, mocking
- domain: testing, databases, developer-tools
- platform: go, cli
- tags: test-fixtures, yaml-fixtures, integration-testing, rails-style, sql

## Member repositories
- go-testfixtures/testfixtures (main) score 78

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:04.962532+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:22:05.488538+00:00, confidence not recorded.
  - readme: https://github.com/go-testfixtures/testfixtures (fetched 2026-08-28T04:04:04.962532+00:00, sha ffe7afe84611)
  - homepage: https://pkg.go.dev/github.com/go-testfixtures/testfixtures/v3?tab=doc (fetched 2026-08-29T12:21:27.820875+00:00, sha 51b58118ca8d)
  - site_page: https://pkg.go.dev/about (fetched 2026-08-29T12:21:27.818623+00:00, sha 757852027879)
  - site_page: https://go.dev/project (fetched 2026-08-29T12:21:27.822658+00:00, sha d5ca00bb378b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
