Skip to content

Commit 0116414

Browse files
committed
Add note about autogenerated tests failing
1 parent 4e0fcdd commit 0116414

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Table of Contents
101101
* [How do I use the types.BytesArray for Postgres bytea arrays?](#how-do-i-use-typesbytesarray-for-postgres-bytea-arrays)
102102
* [Why aren't my time.Time or null.Time fields working in MySQL?](#why-arent-my-timetime-or-nulltime-fields-working-in-mysql)
103103
* [Where is the homepage?](#where-is-the-homepage)
104+
* [Why are the auto-generated tests failing?](#why-are-the-auto-generated-tests-failing)
104105
* [Benchmarks](#benchmarks)
105106

106107
## About SQL Boiler
@@ -1911,6 +1912,25 @@ You *must* use a DSN flag in MySQL connections, see: [Requirements](#requirement
19111912
The homepage for the [SQLBoiler](https://github.com/volatiletech/sqlboiler) [Golang ORM](https://github.com/volatiletech/sqlboiler)
19121913
generator is located at: https://github.com/volatiletech/sqlboiler
19131914

1915+
#### Why are the auto-generated tests failing?
1916+
1917+
The tests generated for your models package with sqlboiler are fairly
1918+
error-prone. They are usually broken by constraints in the database
1919+
that sqlboiler can't hope to understand.
1920+
1921+
During regular run-time this isn't an issue because your code will throw errors
1922+
and you will fix it however the auto-generated tests can only report those
1923+
errors and it seems like something is wrong when in reality the only issue is
1924+
that the auto generated tests can't understand that your `text` column is
1925+
validated by a regex that says it must be composed solely of the 'b' character
1926+
repeated 342 times.
1927+
1928+
These tests are broken especially by foreign key constraints because of the
1929+
parallelism we use. There's also no understanding in the tests of dependencies
1930+
based on these foreign keys. As such there is a process that removes the foreign
1931+
keys from your schema when they are run, if this process messes up you will get
1932+
errors relating to foreign key constraints.
1933+
19141934
## Benchmarks
19151935

19161936
If you'd like to run the benchmarks yourself check out our [boilbench](https://github.com/volatiletech/boilbench) repo.

0 commit comments

Comments
 (0)