mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(ci): extend frozen target hook timeout (#109564)
* fix(ci): extend frozen target hook timeout * test(ci): align package acceptance omission default * fix(android): refresh Japanese disable translation
This commit is contained in:
@@ -1883,6 +1883,9 @@ jobs:
|
||||
OPENCLAW_NODE_TEST_ENV_JSON: ${{ toJson(matrix.env) }}
|
||||
OPENCLAW_NODE_TEST_INCLUDE_PATTERNS_JSON: ${{ toJson(matrix.includePatterns) }}
|
||||
OPENCLAW_NODE_TEST_TARGETS_JSON: ${{ toJson(matrix.targets) }}
|
||||
# Frozen targets can carry integration hooks whose cold setup exceeds
|
||||
# the current 120-second default on shared release runners.
|
||||
OPENCLAW_NODE_TEST_VITEST_ARGS_JSON: ${{ needs.preflight.outputs.compatibility_target == 'true' && '["--hookTimeout=300000"]' || '[]' }}
|
||||
OPENCLAW_VITEST_SHARD_NAME: ${{ matrix.shard_name }}
|
||||
OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS: "300000"
|
||||
OPENCLAW_VITEST_NO_OUTPUT_RETRY: "1"
|
||||
|
||||
@@ -1050,7 +1050,7 @@
|
||||
<string name="native_b78426f40a794c5d" formatted="false" tools:ignore="Typos,TypographyDashes,TypographyEllipsis">"未ペアリング"</string>
|
||||
<string name="native_b7b190b4be0b2385" formatted="false" tools:ignore="Typos,TypographyDashes,TypographyEllipsis">"Gatewayがこのスマートフォンを認識しました"</string>
|
||||
<string name="native_b7b89bf0fd930a9f" formatted="false" tools:ignore="Typos,TypographyDashes,TypographyEllipsis">"設定済みのモデルはありません"</string>
|
||||
<string name="native_b7e3e4aa4257b9a1" formatted="false" tools:ignore="Typos,TypographyDashes,TypographyEllipsis">"無効にする"</string>
|
||||
<string name="native_b7e3e4aa4257b9a1" formatted="false" tools:ignore="Typos,TypographyDashes,TypographyEllipsis">"無効化"</string>
|
||||
<string name="native_b8352b44a588721c" formatted="false" tools:ignore="Typos,TypographyDashes,TypographyEllipsis">"アプリの言語"</string>
|
||||
<string name="native_b8380b8a2317b9fb" formatted="false" tools:ignore="Typos,TypographyDashes,TypographyEllipsis">"Gatewayをペアリング中"</string>
|
||||
<string name="native_b860c709e9ba7e6f" formatted="false" tools:ignore="Typos,TypographyDashes,TypographyEllipsis">"保存済みの認証情報が無効です"</string>
|
||||
|
||||
@@ -17,6 +17,7 @@ const FS_MODULE_CACHE_PATH_ENV_KEY = "OPENCLAW_VITEST_FS_MODULE_CACHE_PATH";
|
||||
const FS_MODULE_CACHE_WRITER_ENV_KEY = "OPENCLAW_VITEST_FS_MODULE_CACHE_WRITER";
|
||||
const NODE_COMPILE_CACHE_PATH_ENV_KEY = "NODE_COMPILE_CACHE";
|
||||
const NODE_COMPILE_CACHE_WRITER_ENV_KEY = "OPENCLAW_NODE_COMPILE_CACHE_WRITER";
|
||||
const VITEST_EXTRA_ARGS_ENV_KEY = "OPENCLAW_NODE_TEST_VITEST_ARGS_JSON";
|
||||
const FS_MODULE_CACHE_MAX_BYTES = 2 * 1024 * 1024 * 1024;
|
||||
const NODE_COMPILE_CACHE_MAX_BYTES = 1024 * 1024 * 1024;
|
||||
const FS_MODULE_CACHE_PRUNE_TARGET_RATIO = 0.75;
|
||||
@@ -220,6 +221,7 @@ function runChild(args, childEnv, label) {
|
||||
|
||||
export async function runShardPlans(plans, options = {}) {
|
||||
const baseEnv = options.env ?? process.env;
|
||||
const vitestExtraArgs = parseJsonEnv(baseEnv, VITEST_EXTRA_ARGS_ENV_KEY, []);
|
||||
const concurrency = Math.max(1, options.concurrency ?? PLAN_CONCURRENCY);
|
||||
const runner = options.runChild ?? runChild;
|
||||
const scratchDir = options.scratchDir ?? mkdtempSync(join(tmpdir(), "openclaw-node-shard-"));
|
||||
@@ -233,12 +235,16 @@ export async function runShardPlans(plans, options = {}) {
|
||||
const index = nextIndex;
|
||||
nextIndex += 1;
|
||||
const entry = plans[index];
|
||||
const args = entry.kind === "target" ? [entry.target] : entry.plan.configs;
|
||||
if (!Array.isArray(args) || args.length === 0) {
|
||||
const targetArgs = entry.kind === "target" ? [entry.target] : entry.plan.configs;
|
||||
if (!Array.isArray(targetArgs) || targetArgs.length === 0) {
|
||||
console.error(`Missing node test shard configs for ${entry.name}`);
|
||||
exitCode = exitCode || 1;
|
||||
return;
|
||||
}
|
||||
const args =
|
||||
Array.isArray(vitestExtraArgs) && vitestExtraArgs.length > 0
|
||||
? [...targetArgs, "--", ...vitestExtraArgs]
|
||||
: targetArgs;
|
||||
const childEnv = buildChildEnv(entry, baseEnv, scratchDir, index, {
|
||||
serial: concurrency === 1,
|
||||
cacheSlot,
|
||||
|
||||
@@ -152,6 +152,30 @@ describe("scripts/ci-run-node-test-shard.mjs", () => {
|
||||
expect(new Set(seen.map((run) => run.cache)).size).toBe(3);
|
||||
});
|
||||
|
||||
it("forwards trusted Vitest arguments after the target separator", async () => {
|
||||
const scratchDir = makeScratchDir();
|
||||
const seen: string[][] = [];
|
||||
const exitCode = await runShardPlans(
|
||||
resolveShardPlans({
|
||||
OPENCLAW_NODE_TEST_CONFIGS_JSON: JSON.stringify(["test/vitest/vitest.unit.config.ts"]),
|
||||
}),
|
||||
{
|
||||
concurrency: 1,
|
||||
env: {
|
||||
OPENCLAW_NODE_TEST_VITEST_ARGS_JSON: JSON.stringify(["--hookTimeout=300000"]),
|
||||
},
|
||||
runChild: async (args: string[]) => {
|
||||
seen.push(args);
|
||||
return 0;
|
||||
},
|
||||
scratchDir,
|
||||
},
|
||||
);
|
||||
|
||||
expect(exitCode).toBe(0);
|
||||
expect(seen).toEqual([["test/vitest/vitest.unit.config.ts", "--", "--hookTimeout=300000"]]);
|
||||
});
|
||||
|
||||
it("reuses isolated persistent cache slots across serial work", async () => {
|
||||
const scratchDir = makeScratchDir();
|
||||
const persistentRoot = path.join(makeScratchDir(), "persistent");
|
||||
|
||||
@@ -3800,6 +3800,9 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}"
|
||||
expect(runStep.env.OPENCLAW_VITEST_NO_OUTPUT_RETRY).toBe("1");
|
||||
expect(runStep.env.OPENCLAW_NODE_TEST_ENV_JSON).toBe("${{ toJson(matrix.env) }}");
|
||||
expect(runStep.env.OPENCLAW_NODE_TEST_TARGETS_JSON).toBe("${{ toJson(matrix.targets) }}");
|
||||
expect(runStep.env.OPENCLAW_NODE_TEST_VITEST_ARGS_JSON).toBe(
|
||||
"${{ needs.preflight.outputs.compatibility_target == 'true' && '[\"--hookTimeout=300000\"]' || '[]' }}",
|
||||
);
|
||||
expect(runStep.env.JOB_CONTEXT_JSON).toBe("${{ toJSON(job) }}");
|
||||
// Shard execution policy lives in the unit-tested wrapper script. Frozen
|
||||
// release targets load that wrapper from the exact trusted workflow SHA.
|
||||
|
||||
@@ -2385,7 +2385,7 @@ describe("package artifact reuse", () => {
|
||||
});
|
||||
expect(dockerAcceptanceJob.with).toMatchObject({
|
||||
allow_frozen_target_scenario_omissions:
|
||||
"${{ inputs.allow_frozen_target_scenario_omissions }}",
|
||||
"${{ inputs.allow_frozen_target_scenario_omissions || false }}",
|
||||
});
|
||||
expect(workflow).toContain(
|
||||
"live_repo_e2e_release_checks:\n name: Run repo/live E2E validation\n needs: [resolve_target]",
|
||||
|
||||
Reference in New Issue
Block a user