Testing on Databricks
Ephemeral test environments
Per-PR Unity Catalog schemas and Lakebase branches — created, seeded, tested, and destroyed by CI.
Status: Available (Phase 4). Unity Catalog scratch schemas, JSON fixture seeding, TTL metadata/reaping, and the reusable workflow are implemented. Optional Lakebase branch provisioning remains a follow-on.
Shared, long-lived test workspaces rot: fixtures drift, grants accumulate, and tests start depending on state nobody remembers creating. The ephemeral tier gives every pull request its own scratch environment.
CLI
fx test env create --name pr-1234 --seed fixtures/ --ttl 24h
fx test env list
fx test env destroy --name pr-1234create provisions:
- a Unity Catalog schema
fx_pr_1234(optionally its own catalog), withUSE/SELECT/MODIFYgranted only to the CI service principal; - optionally a Lakebase branch for control-plane database tests;
- seeded fixture tables from
--seed; - an environment manifest recording everything created, so
destroyis exact.
Environments carry a TTL; a scheduled reaper destroys anything past it, so a crashed CI run can never leak workspace state.
Reusable CI workflow
Any repository can consume the published workflow:
jobs:
databricks-tests:
uses: Fabric-Pro/fabric-experiments/.github/workflows/databricks-test.yml@main
with:
seed: fixtures/
catalog: tf_databricks
warehouse_id: 599af4d9378acba2
test_command: pnpm test:features
secrets:
DATABRICKS_HOST: ${{ secrets.DATABRICKS_HOST }}
DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }}
DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }}The workflow runs, in order:
- local-profile BDD features and unit suites (no workspace needed — always on);
fx test env createfor the PR;- live-profile BDD features and the live check suite inside that environment;
fx test env destroy, unconditionally (if: always()).
Scoping rules
- One environment per PR; scenario-scoped scratch schemas nest inside it.
- The CI principal's grants are confined to the PR schema — enforced by the governance scenarios in the BDD suite, so a grant misconfiguration is itself a test failure.
- Fixtures are committed files; an environment is fully reproducible from the repo at any commit.