You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(testing): live-stack test harness — deploy/assert/destroy per suite, emulator-aware #1224
Filed for review. Scope and approach not yet confirmed.
A user-facing test harness for stacks: deploy a real instance once per suite, run assertions against the live resources, tear it down — emulator-locally, real-cloud in CI.
Finding
@intentius/chant-test-utils serves chant's own development (mock entities, describeExample), not chant users. A project consuming chant has no supported way to write "deploy my stack, assert against it, destroy it" as a vitest suite. The pieces exist: local executor runs ApplyOp with no server, environments entries carry an endpoint for emulator targeting, chant emulator up (#920) boots emulators, and observation reads back live state.
Want
1. Suite-scoped lifecycle helpers
Exported from test-utils (or a new subpath @intentius/chant/testing):
conststack=awaitdeployStack({dir: ".",env: "test-<suite>",params: {...}});// stack.outputs, stack.entities, stack.envawaitstack.assertLive("uploads");// observation-backed existence/status checkawaitstack.destroy();// marker-scoped teardown of the suite env
deployStack = build (env-scoped names, #1221) + additive local-executor apply; destroy = #1222's teardown. One deploy per suite (beforeAll/afterAll), not per test.
2. Isolation
Default env name derives from suite + a run nonce so parallel CI jobs don't collide; document --env-override for shared long-lived test envs.
3. Emulator-aware by default
When the target env declares an endpoint (or chant emulator up --json env is applied), the same suite runs creds-free against Floci/floci-az/floci-gcp/flaps. CI can point the identical suite at a real account.
Acceptance
A worked example under one lexicon's examples: suite deploys, asserts an output and a live resource attribute, destroys; green against the emulator in a Docker-gated test.
Teardown runs in afterAll even when assertions fail; a crashed suite's env is recoverable by rerunning destroy (stateless, marker-scoped).
Docs page (local-testing section) covering the harness, isolation naming, and the emulator/real-cloud switch.
Scope confirmed (build, modified). Verified against current code.
Premise updates:runOpLocally is already exported from @intentius/chant/op and core's export map supports subpaths, so the harness is a thin composition layer, not new machinery. environments: [{name, endpoint}] + environmentEndpoint() (#1166) and chant emulator up --json (#920, widened by #1368) provide the emulator switch as filed. test-utils stays private: true.
V1 = a @intentius/chant/testing subpath in core exporting deployStack({ dir, env?, params? }) — programmatic build (config resolution mirrored from example-harness) + additive ApplyOp via runOpLocally, returning { outputs, entities, env, destroy } — with destroy() delegating in-process to #1222's marker sweep. Default env = suite name + run nonce. Emulator-aware via declared endpoints / emulator env. One worked AWS+Floci example suite, Docker-gated, teardown in afterAll surviving assertion failure; crashed-suite recovery = rerun destroy (stateless by #1222's design). Docs page under local-testing/.
Out (v1):assertLive as a rich API (follow-up issue; at most an observation-backed existence check for AWS), multi-lexicon example parity, Temporal path, a chant test CLI verb.
Blocked on:#1221 (same dynamic-env legality contract as #1223's pr-*, plus envName() for collision-free physical names) and #1222 (teardown exported as a function, holes surfaced as failures).
Plan: PR A @intentius/chant/testing + unit tests vs mock plugin; PR B worked AWS/Floci example suite + just target; PR C docs page; follow-up issue for assertLive.
Activity
lex00 commentedon Aug 24, 2026
Scope confirmed (build, modified). Verified against current code.
Premise updates:
runOpLocallyis already exported from@intentius/chant/opand core's export map supports subpaths, so the harness is a thin composition layer, not new machinery.environments: [{name, endpoint}]+environmentEndpoint()(#1166) andchant emulator up --json(#920, widened by #1368) provide the emulator switch as filed.test-utilsstaysprivate: true.V1 = a
@intentius/chant/testingsubpath in core exportingdeployStack({ dir, env?, params? })— programmatic build (config resolution mirrored from example-harness) + additive ApplyOp viarunOpLocally, returning{ outputs, entities, env, destroy }— withdestroy()delegating in-process to #1222's marker sweep. Default env = suite name + run nonce. Emulator-aware via declared endpoints / emulator env. One worked AWS+Floci example suite, Docker-gated, teardown inafterAllsurviving assertion failure; crashed-suite recovery = rerun destroy (stateless by #1222's design). Docs page under local-testing/.Out (v1):
assertLiveas a rich API (follow-up issue; at most an observation-backed existence check for AWS), multi-lexicon example parity, Temporal path, achant testCLI verb.Blocked on: #1221 (same dynamic-env legality contract as #1223's
pr-*, plusenvName()for collision-free physical names) and #1222 (teardown exported as a function, holes surfaced as failures).Plan: PR A
@intentius/chant/testing+ unit tests vs mock plugin; PR B worked AWS/Floci example suite + just target; PR C docs page; follow-up issue forassertLive.feat(testing): @intentius/chant/testing — deployStack/destroy live-st…
docs(local-testing): test harness page — deployStack per suite, isola…
feat(examples): testing-harness-aws — worked Floci suite for the live…
lex00 commentedon Aug 24, 2026
Shipped: #1853 (@intentius/chant/testing deployStack/destroy), #1858 (worked Floci example + Docker-gated suite, absorbing #1856's docs page). assertLive follow-up: #1857.