mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix: simplify testbox changed-check delegation
This commit is contained in:
@@ -149,7 +149,7 @@ pnpm crabbox:run -- \
|
||||
--ttl 240m \
|
||||
--timing-json \
|
||||
--shell -- \
|
||||
"env CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm test:changed"
|
||||
"pnpm test:changed"
|
||||
```
|
||||
|
||||
Full suite:
|
||||
@@ -160,7 +160,7 @@ pnpm crabbox:run -- \
|
||||
--ttl 240m \
|
||||
--timing-json \
|
||||
--shell -- \
|
||||
"env CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm test"
|
||||
"pnpm test"
|
||||
```
|
||||
|
||||
Focused rerun:
|
||||
@@ -171,7 +171,7 @@ pnpm crabbox:run -- \
|
||||
--ttl 240m \
|
||||
--timing-json \
|
||||
--shell -- \
|
||||
"env CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm test <path-or-filter>"
|
||||
"pnpm test <path-or-filter>"
|
||||
```
|
||||
|
||||
Read the JSON summary. Useful fields:
|
||||
@@ -206,7 +206,7 @@ node scripts/crabbox-wrapper.mjs run \
|
||||
--ttl 240m \
|
||||
--timing-json \
|
||||
-- \
|
||||
CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 pnpm check:changed
|
||||
corepack pnpm check:changed
|
||||
```
|
||||
|
||||
Read the JSON summary and the Testbox line. Useful fields:
|
||||
@@ -544,14 +544,14 @@ If brokered AWS cannot dispatch, sync, attach, or stop, retry once with
|
||||
|
||||
```sh
|
||||
pnpm crabbox:run -- --debug --timing-json -- \
|
||||
CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm test:changed
|
||||
pnpm test:changed
|
||||
```
|
||||
|
||||
Full suite:
|
||||
|
||||
```sh
|
||||
pnpm crabbox:run -- --debug --timing-json -- \
|
||||
CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm test
|
||||
pnpm test
|
||||
```
|
||||
|
||||
Auth fallback, only when `blacksmith` says auth is missing:
|
||||
@@ -591,7 +591,7 @@ Minimal Blacksmith-backed Crabbox run, from repo root:
|
||||
|
||||
```sh
|
||||
pnpm crabbox:run -- --provider blacksmith-testbox --timing-json -- \
|
||||
CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test:changed
|
||||
corepack pnpm test:changed
|
||||
```
|
||||
|
||||
Use direct Blacksmith only when Crabbox is the broken layer and you are
|
||||
@@ -617,7 +617,7 @@ provider deliberately.
|
||||
```sh
|
||||
pnpm crabbox:warmup -- --class beast --market on-demand --idle-timeout 90m
|
||||
pnpm crabbox:hydrate -- --id <cbx_id-or-slug>
|
||||
pnpm crabbox:run -- --id <cbx_id-or-slug> --timing-json --shell -- "env NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm test:changed"
|
||||
pnpm crabbox:run -- --id <cbx_id-or-slug> --timing-json --shell -- "pnpm test:changed"
|
||||
pnpm crabbox:stop -- <cbx_id-or-slug>
|
||||
```
|
||||
|
||||
|
||||
@@ -576,7 +576,7 @@ pnpm crabbox:run -- --provider blacksmith-testbox \
|
||||
--ttl 240m \
|
||||
--timing-json \
|
||||
--shell -- \
|
||||
"env CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm check:changed"
|
||||
"corepack pnpm check:changed"
|
||||
```
|
||||
|
||||
Focused test rerun:
|
||||
@@ -591,7 +591,7 @@ pnpm crabbox:run -- --provider blacksmith-testbox \
|
||||
--ttl 240m \
|
||||
--timing-json \
|
||||
--shell -- \
|
||||
"env CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm test <path-or-filter>"
|
||||
"corepack pnpm test <path-or-filter>"
|
||||
```
|
||||
|
||||
Full suite:
|
||||
@@ -606,7 +606,7 @@ pnpm crabbox:run -- --provider blacksmith-testbox \
|
||||
--ttl 240m \
|
||||
--timing-json \
|
||||
--shell -- \
|
||||
"env CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm test"
|
||||
"corepack pnpm test"
|
||||
```
|
||||
|
||||
Read the final JSON summary. The useful fields are `provider`, `leaseId`, `syncDelegated`, `exitCode`, `commandMs`, and `totalMs`. One-shot Blacksmith-backed Crabbox runs should stop the Testbox automatically; if a run is interrupted or cleanup is unclear, inspect live boxes and stop only the boxes you created:
|
||||
@@ -641,7 +641,7 @@ Escalate to owned Crabbox capacity only when Blacksmith is down, quota-limited,
|
||||
CRABBOX_CAPACITY_REGIONS=eu-west-1,eu-west-2,eu-central-1,us-east-1,us-west-2 \
|
||||
pnpm crabbox:warmup -- --provider aws --class standard --market on-demand --idle-timeout 90m
|
||||
pnpm crabbox:hydrate -- --id <cbx_id-or-slug>
|
||||
pnpm crabbox:run -- --id <cbx_id-or-slug> --timing-json --shell -- "env NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm check:changed"
|
||||
pnpm crabbox:run -- --id <cbx_id-or-slug> --timing-json --shell -- "pnpm check:changed"
|
||||
pnpm crabbox:stop -- <cbx_id-or-slug>
|
||||
```
|
||||
|
||||
|
||||
@@ -80,9 +80,6 @@ export function shouldDelegateChangedCheckToCrabbox(argv = [], env = process.env
|
||||
if (!isTruthyEnvFlag(env.OPENCLAW_TESTBOX)) {
|
||||
return false;
|
||||
}
|
||||
if (isTruthyEnvFlag(env.OPENCLAW_TESTBOX_REMOTE_RUN)) {
|
||||
return false;
|
||||
}
|
||||
if (isTruthyEnvFlag(env.CI) || isTruthyEnvFlag(env.GITHUB_ACTIONS)) {
|
||||
return false;
|
||||
}
|
||||
@@ -112,13 +109,6 @@ export function buildChangedCheckCrabboxArgs(argv = []) {
|
||||
"240m",
|
||||
"--timing-json",
|
||||
"--",
|
||||
"CI=1",
|
||||
"NODE_OPTIONS=--max-old-space-size=4096",
|
||||
"OPENCLAW_TEST_PROJECTS_PARALLEL=6",
|
||||
"OPENCLAW_VITEST_MAX_WORKERS=1",
|
||||
"OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000",
|
||||
"OPENCLAW_TESTBOX=1",
|
||||
"OPENCLAW_TESTBOX_REMOTE_RUN=1",
|
||||
"corepack",
|
||||
"pnpm",
|
||||
"check:changed",
|
||||
@@ -378,11 +368,7 @@ async function runPlanCommand(command, timings) {
|
||||
|
||||
export function createPnpmManagedCommand(command, env = process.env) {
|
||||
const commandEnv = command.env ?? resolveLocalHeavyCheckEnv(env);
|
||||
if (
|
||||
isTruthyEnvFlag(commandEnv.OPENCLAW_TESTBOX_REMOTE_RUN) ||
|
||||
isTruthyEnvFlag(commandEnv.CI) ||
|
||||
isTruthyEnvFlag(commandEnv.GITHUB_ACTIONS)
|
||||
) {
|
||||
if (isTruthyEnvFlag(commandEnv.CI) || isTruthyEnvFlag(commandEnv.GITHUB_ACTIONS)) {
|
||||
const shimmedEnv = prependCorepackPnpmShim(commandEnv);
|
||||
return {
|
||||
...command,
|
||||
|
||||
@@ -299,18 +299,6 @@ describe("scripts/changed-lanes", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("runs remote Testbox changed-check children through Corepack pnpm", () => {
|
||||
const command = createPnpmManagedCommand(
|
||||
{ name: "conflict markers", args: ["check:no-conflict-markers"] },
|
||||
{ OPENCLAW_TESTBOX_REMOTE_RUN: "1", PATH: "/usr/bin" },
|
||||
);
|
||||
|
||||
expect(command.bin).toBe("corepack");
|
||||
expect(command.args).toEqual(["pnpm", "check:no-conflict-markers"]);
|
||||
expect(command.env?.PATH).not.toBe("/usr/bin");
|
||||
expect(command.env?.PATH).toContain("/usr/bin");
|
||||
});
|
||||
|
||||
it("runs CI changed-check children through Corepack pnpm", () => {
|
||||
const command = createPnpmManagedCommand(
|
||||
{ name: "conflict markers", args: ["check:no-conflict-markers"] },
|
||||
@@ -358,13 +346,6 @@ describe("scripts/changed-lanes", () => {
|
||||
"240m",
|
||||
"--timing-json",
|
||||
"--",
|
||||
"CI=1",
|
||||
"NODE_OPTIONS=--max-old-space-size=4096",
|
||||
"OPENCLAW_TEST_PROJECTS_PARALLEL=6",
|
||||
"OPENCLAW_VITEST_MAX_WORKERS=1",
|
||||
"OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000",
|
||||
"OPENCLAW_TESTBOX=1",
|
||||
"OPENCLAW_TESTBOX_REMOTE_RUN=1",
|
||||
"corepack",
|
||||
"pnpm",
|
||||
"check:changed",
|
||||
@@ -375,7 +356,7 @@ describe("scripts/changed-lanes", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("does not delegate dry-run, CI, or already-remote changed gates", () => {
|
||||
it("does not delegate dry-run or CI changed gates", () => {
|
||||
expect(shouldDelegateChangedCheckToCrabbox(["--dry-run"], { OPENCLAW_TESTBOX: "1" })).toBe(
|
||||
false,
|
||||
);
|
||||
@@ -383,12 +364,6 @@ describe("scripts/changed-lanes", () => {
|
||||
shouldDelegateChangedCheckToCrabbox([], { OPENCLAW_TESTBOX: "1", GITHUB_ACTIONS: "true" }),
|
||||
).toBe(false);
|
||||
expect(shouldDelegateChangedCheckToCrabbox([], { OPENCLAW_TESTBOX: "1", CI: "1" })).toBe(false);
|
||||
expect(
|
||||
shouldDelegateChangedCheckToCrabbox([], {
|
||||
OPENCLAW_TESTBOX: "1",
|
||||
OPENCLAW_TESTBOX_REMOTE_RUN: "1",
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("runs changed-check lint lanes under the parent heavy-check lock", () => {
|
||||
@@ -1005,7 +980,7 @@ describe("scripts/changed-lanes", () => {
|
||||
"apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift",
|
||||
]);
|
||||
const plan = createChangedCheckPlan(result, {
|
||||
env: { OPENCLAW_TESTBOX_REMOTE_RUN: "1", PATH: "/usr/bin" },
|
||||
env: { CI: "1", PATH: "/usr/bin" },
|
||||
platform: "linux",
|
||||
swiftlintAvailable: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user