foundation tier

foundation-test-support

Test support utilities for rust-framework-workspace - live-Postgres harness via env-var connection (Docker retired, sprint 0.38)

Test support utilities for rust-framework-workspace - live-Postgres harness via env-var connection (Docker retired, sprint 0.38)

Tierfoundation
Roleunclassified (baselined)
Pathcrates/foundation/test-support
Edition2021
Targetsfoundation_test_support, calendar_contracts
Public items0 across 0 modules
Tests24

What it is for

Test support utilities for rust-framework-workspace.

Provides a Testcontainers-based PostgreSQL harness that:

# Usage

use foundation_test_support::TestDb;

#tokio::test
async fn test_something() {
let db = TestDb::new().await.expect("Failed to start test database");
let pool = db.pool();

// Your test code here using pool
}

# Migration Order

Migrations are applied in a strict topological order based on dependencies: 1. Foundation layer (basemodels first) 2. Identity layer (parties, then auth, rbac, identifiers) 3. Domain layer (encounters, catalog, billing, etc.) 4. Content layer (documents, notes, cms) 5. Infrastructure layer (communication)

# CI Considerations

Capabilities

No public items.

How to use it

From this crate's own rustdoc:

use foundation_test_support::TestDb;

#[tokio::test]
async fn test_something() {
    let db = TestDb::new().await.expect("Failed to start test database");
    let pool = db.pool();

    // Your test code here using pool
}

Module structure

No public modules: the crate root is its whole surface.

Public surface

No public items.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
MigrationOrdermigrations::MigrationOrder
PgPoolsqlx::PgPool
repo_root_fromrepo_root::repo_root_from
{TestDb,TestDbError}harness::{TestDb,TestDbError}
{assert_all_escapes_refused,assert_command_confined,assert_command_confined_with,escape_candidates,BoundaryWatch,EscapeCandidate,Violation,}boundary::{assert_all_escapes_refused,assert_command_confined,assert_command_confined_with,escape_candidates,BoundaryWatch,EscapeCandidate,Violation,}

Boundary

Depends on no other workspace tier.

Shares tier foundation with 27 other crates: foundation-audit-log, foundation-basemodels, foundation-bounded-io, foundation-conversation-closure, foundation-crypto-sign, foundation-decisioning, foundation-encounter-vocabulary, foundation-fs-metadata, … (27 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)foundation
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/foundation/test-support
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
tempfile^3noalways
thiserror^2noalways
tokio^1fullnoalways
tracing^0.1noalways

Development, in this workspace.

CrateTierOptionalOnly on
`content-calendar`contentnoalways
`content-calendar-recurrence`contentnoalways
`identity-parties`identitynoalways
`operations-planning`operationsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
tokio-test^0.4noalways
uuid^1v4, v7, serde, jsnoalways

Build. None.

Depended on by. 3 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_tools_corpus["tools-corpus"] -->|uses| SELF
  n_tools_session_error_audit["tools-session-error-audit"] -->|uses| SELF
  n_tools_untracked_intake["tools-untracked-intake"] -->|uses| SELF
  SELF["foundation-test-support"]
  SELF -->|development| n_content_calendar["content-calendar"]
  SELF -->|development| n_content_calendar_recurrence["content-calendar-recurrence"]
  SELF -->|development| n_identity_parties["identity-parties"]
  SELF -->|development| n_operations_planning["operations-planning"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libfoundation_test_support`src/lib.rs`
testcalendar_contracts`tests/calendar_contracts.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimeyes
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
DATABASE_URLsrc/harness.rs
TEST_DATABASE_URLsrc/harness.rs

3 workspace crates depend on this one: tools-corpus, tools-session-error-audit, tools-untracked-intake.

Verification

KindCount
Unit tests19
Integration tests5
Examples0
Doctests1

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc00
Public modules with a //! block00

Metrics

MetricValue
Rust source files5
Source lines1685
Code lines963
Public API items0
Public modules0
Tests24
Examples0
Cargo features0
Direct runtime dependencies5
Workspace reverse dependencies3
pie showData
    title Rust source composition
    "Code" : 963
    "Blank or comment" : 722

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All foundation · Manual