





















@@ -16,6 +16,19 @@ warm caches, local build state, and fast feedback.
16161717Testbox is the expensive path. Reach for it deliberately.
181819+OpenClaw maintainers can opt into Testbox-first validation by setting
20+`OPENCLAW_TESTBOX=1` in their environment or standing agent rules. This mode is
21+maintainers-only and requires Blacksmith access.
22+23+When `OPENCLAW_TESTBOX=1` is set in OpenClaw:
24+25+- Pre-warm a Testbox early for longer, wider, or uncertain work.
26+- Prefer Testbox for `pnpm` gates, e2e, package-like proof, and broad suites.
27+- Reuse the same Testbox ID for every run command in the same task/session.
28+- Use local commands only when the task explicitly sets
29+`OPENCLAW_LOCAL_CHECK_MODE=throttled|full`, or when the user asks for local
30+ proof.
31+1932## Install the CLI
20332134If `blacksmith` is not installed, install it:
@@ -81,17 +94,18 @@ Prefer Testbox when:
8194- you are reproducing CI-only failures
8295- you need the exact workflow image/job environment from GitHub Actions
839684-For OpenClaw specifically, normal local iteration should stay local:
97+For OpenClaw specifically, normal local iteration stays local unless maintainer
98+Testbox mode is enabled with `OPENCLAW_TESTBOX=1`:
859986100- `pnpm check:changed`
87101- `pnpm test:changed`
88102- `pnpm test <path-or-filter>`
89103- `pnpm test:serial`
90104- `pnpm build`
9110592-Only use Testbox in OpenClaw when the user explicitly wants CI-parity or the
93-check truly depends on remote secrets/services that the local repo loop cannot
94-provide.
106+If `OPENCLAW_TESTBOX=1` is enabled, run those same repo commands inside the
107+warm Testbox. If the user wants laptop-friendly local proof for one command, use
108+the explicit escape hatch `OPENCLAW_LOCAL_CHECK_MODE=throttled`.
9510996110For installable-package product proof, prefer the GitHub `Package Acceptance`
97111workflow over an ad hoc Testbox command. It resolves one package candidate
@@ -103,21 +117,35 @@ an older trusted branch, tag, or SHA.
103117104118## Setup: Warmup before coding
105119106-If you decided Testbox is actually warranted, warm one up early. This returns
107-an ID instantly and boots the CI environment in the background while you work:
120+If you decided Testbox is warranted, warm one up early. This returns an ID
121+instantly and boots the CI environment in the background while you work:
108122109123blacksmith testbox warmup ci-check-testbox.yml
110124# → tbx_01jkz5b3t9...
111125112126Save this ID. You need it for every `run` command.
113127128+For OpenClaw maintainer Testbox mode, pre-warm at the start of longer or wider
129+tasks:
130+131+blacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90
132+133+Use the build-artifact warmup when e2e/package/build proof benefits from seeded
134+`dist/`, `dist-runtime/`, and build-all caches:
135+136+blacksmith testbox warmup ci-build-artifacts-testbox.yml --ref main --idle-timeout 90
137+114138Warmup dispatches a GitHub Actions workflow that provisions a VM with the
115139full CI environment: dependencies installed, services started, secrets
116140injected, and a clean checkout of the repo at the default branch.
117141142+In OpenClaw, raw commit SHAs are not reliable dispatch refs for `warmup --ref`;
143+use a branch or tag. The build-artifact workflow resolves `openclaw@beta` and
144+`openclaw@latest` to SHA cache keys internally.
145+118146Options:
119147120---ref <branch> Git ref to dispatch against (default: repo's default branch)
148+--ref <branch|tag> Git ref to dispatch against (default: repo's default branch)
121149--job <name> Specific job within the workflow (if it has multiple)
122150--idle-timeout <min> Idle timeout in minutes (default: 30)
123151@@ -234,6 +262,11 @@ services, CI-only runners, or reproducibility against the workflow image.
234262235263If the repo says local tests/builds are the normal path, follow the repo.
236264265+OpenClaw maintainer exception: if `OPENCLAW_TESTBOX=1` is set by the user or
266+agent environment, treat Testbox as the normal validation path for this repo.
267+Use `OPENCLAW_LOCAL_CHECK_MODE=throttled|full` as the explicit local escape
268+hatch.
269+237270## When to use
238271239272Use Testbox when:
@@ -250,12 +283,13 @@ checks that need parity or remote state.
250283251284## Workflow
252285253-1. Decide whether the repo's local loop is the right default.
254-2. Only if Testbox is warranted, warm up early:
255-`blacksmith testbox warmup ci-check-testbox.yml` → save the ID
286+1. Decide whether the repo's local loop is the right default. For OpenClaw,
287+`OPENCLAW_TESTBOX=1` makes Testbox the maintainer default.
288+2. If Testbox is warranted, warm up early:
289+`blacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90` → save the ID
2562903. Write code while the testbox boots in the background.
2572914. Run the remote command when needed:
258-`blacksmith testbox run --id <ID> "npm test"`
292+`blacksmith testbox run --id <ID> "pnpm check:changed"`
2592935. If tests fail, fix code and re-run against the same warm box.
2602946. If you changed dependency manifests (package.json, etc.), prepend
261295 the install command: `blacksmith testbox run --id <ID> "npm install && npm test"`
@@ -276,9 +310,9 @@ Observed full-suite time on Blacksmith Testbox is about 3-4 minutes:
276310- 173-180s on a warmed box
277311- 219s on a fresh 32-vCPU box
278312279-When validating before commit/push, run `pnpm check:changed` first when
280-appropriate, then the full suite with the profile above if broad confidence is
281-needed.
313+When validating before commit/push in maintainer Testbox mode, run
314+`pnpm check:changed` inside the warmed box first when appropriate, then the full
315+suite with the profile above if broad confidence is needed.
282316283317## Examples
284318@@ -332,12 +366,14 @@ timeout is reached). Default timeout is 5m; use `--wait-timeout` for longer
332366blacksmith testbox stop --id <ID>
333367334368Testboxes automatically shut down after being idle (default: 30 minutes).
335-If you need a longer session, increase the timeout at warmup time:
369+If you need a longer session, increase the timeout at warmup time. For OpenClaw
370+maintainer work, use 90 minutes for long-running sessions:
336371337-blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 60
372+blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 90
373+blacksmith testbox warmup ci-build-artifacts-testbox.yml --idle-timeout 90
338374339375## With options
340376341377blacksmith testbox warmup ci-check-testbox.yml --ref main
342-blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 60
378+blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 90
343379blacksmith testbox run --id <ID> "go test ./..."
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。