Testing and Migrations
Running Tests
Unit and component tests run without extra infrastructure:
dotnet testFunctional tests require PostgreSQL. Start it locally before running the suite:
docker run -d --name hyperpath-test-db -e POSTGRES_USER=hyperpath -e POSTGRES_PASSWORD=hyperpath -p 50035:5432 postgres:16If the container already exists but is stopped:
docker start hyperpath-test-dbThe test factory creates and tears down HyperPathTestDB and TenantTestDB automatically.
Build, Test, and Format in One Step
BuildTestFormat.cs is a single-file app that starts the test database container, runs the tests, and verifies formatting.
dotnet BuildTestFormat.csDatabase Migrations
Migrations are stored in HyperPath.Web.
Applying Migrations
Aspire runs migrations automatically through HyperPath.MigrationService.
For manual application:
scripts/apply-migrations.shAdding Migrations
scripts/add-migration.sh {DbContextName} {NewMigrationName}Locating the Connection String
Because Aspire provisions the database with generated ports and credentials, open the Aspire dashboard, choose the Web application, and copy ConnectionStrings__HyperPathDB.
The migration scripts read that environment variable if it is already set in the shell.