goalline How it worksClaude Code hookGitHub ActionBenchmarkCommandsGitHub

goalline / Database inputs

Test caching that notices when the database schema changed

A test run can pass because of the database it hit, not the code. goalline run --input db=pg reads the schema PostgreSQL reports right before and right after the gate and keeps its hash on the receipt, so a pass on one schema never stands in for another.

The problem

Test result caching keys on the code. But a dev database that drifted, a migration that half-applied or another server version can make the same code pass or fail, and the cache can't see any of it.

Name what the gate depends on

goalline run --gate api --reuse --input db=pg -- npx jest apps/api
goalline verify --require unit,api --input db=pg

goalline reads each input right before and right after the gate and keeps a hash of it on the receipt. In verify and --reuse, the receipt counts only while the same probe reads the same thing, and never when an input changed during the run. --reuse says why an earlier pass no longer counts.

PostgreSQL: db=pg

Any other database

Any other probe is a command whose output says what matters:

goalline run --gate api --input db="sqlite3 dev.db .schema" -- npm test
goalline run --gate api --input db="mysqldump --no-data --skip-dump-date app" -- npm test

Only the gates that use it

In rules.json, inputs says which gates depend on what, so a schema change doesn't re-run the unit tests:

{ "inputs": { "api-*": ["db"] } }

A gate the rules tie to an input that no --input reads gets a receipt that proves nothing, and says why.

Limits

Related