Skip to main content

Crate ares_test_support

Crate ares_test_support 

Source
Expand description

Shared live-test database harness for ARES integration tests.

One resolver, one lifecycle, one failure policy for every crate’s live Postgres tests (ares_test):

  • URL resolution: TEST_DATABASE_URL -> DATABASE_URL (postgres URLs only, rewritten to ares_test) -> unix-socket peer auth, no credentials needed.
  • Lifecycle: once per test binary — connect, run migrations, truncate; the tables are truncated again when the binary exits, so ares_test is left empty between runs.
  • Failure policy: a configured-but-unreachable database fails loudly with fix instructions instead of panicking mid-test or silently skipping.

Functions§

client
A fresh connection wrapped as ares_store::PostgresClient.
pool
Connect to ares_test.
test_db_url
Returns the test database URL.