Documentation
¶
Overview ¶
Package exampletest is the harness every examples/<name> test uses. It gives the test a database that has the example's migrations applied, so the example is proven against a real server by the same CI job that runs the integration suite.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckGenerated ¶
CheckGenerated fails when the generated code of the example in the working directory is stale, by running the real generator in check mode. It is the test-side twin of `momo generate`, so a model edit without a regenerate cannot reach main.
func Open ¶
Open creates a scratch PostgreSQL database with the vector extension, applies the example's migrations (the migrations directory next to its main.go) and returns a handle on it. The database is dropped when the test ends. The test is skipped when MOMO_TEST_POSTGRES_URL is unset, and fails instead when MOMO_REQUIRE_INTEGRATION=1, as in CI.
Types ¶
This section is empty.