Repository navigation
Multi-step fixtures: capture, restart step, data-isolation helper (refs #256) - #303
Conversation
…ion test helper (#256) Ordered steps in tests/requests.json share captured values through {{name}} substitution. A restart step closes and restarts the runtime on the same project and data directory. startServer gains dataDir/isolateData. audit and test run restart steps; verify-deployment skips such fixtures explicitly. Co-Authored-By: Claude Sonnet 5 <[email protected]>
7bb25e9 to
3fdbcda
Compare
|
Maintainer decision on the open question ( Why: under the trust-by-default model ( Conditions (please confirm each in the diff; not verified by the maintainer):
If any condition is not met, fix it before merge. Also please explain or fix the failing |
|
What blocks merge: the Failing step: "Smoke test isolated functions in constrained container" ( Hypothesis (not reproduced, code not read): this PR makes Options if that is the cause:
Please confirm the cause by running the smoke-test command locally before choosing. |
The container smoke test runs it on a read-only filesystem, where mkdtemp failed. Run without offering URLCODE_DATA_DIR instead. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Refs #256 (does not close it).
What
tests/requests.jsonentries may be{"steps": [...]}: ordered requests withcapture(JSON body path or single header) and{{name}}substitution, plus{"restart": true}, which closes and restarts the runtime on the same project and data directory.startServergainsdataDir/isolateData(offered asURLCODE_DATA_DIR);startServer({port: 0})is the in-process helper.urlcode testandurlcode audituse a per-run temp data dir.--targetdecision:verify-deploymentcannot restart a live deployment, so a fixture containing a restart step is skipped whole, with anotesentry and askippedlog event (never silent, does not fail the run).auditProjecton an app that cannot restart refuses.{{name}}is captured by an earlier step.examples/lifecycle. Tests:test/fixture-steps.test.ts.Verification
npm run verifypasses (lint, typecheck, check incl. check:docs, build, tests, workspaces).Open decision
To let the example read the data directory without an operator policy pinned to the project hash,
startServerwith a data dir grants only{env: URLCODE_DATA_DIR}for that run (grantDataDirin RuntimeOptions). Maintainer should confirm this narrow test-harness grant is acceptable.🤖 Generated with Claude Code