ci(release): pass vitest batch options before roots · openclaw/openclaw@3b023e9
steipete
·
2026-05-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -16,15 +16,7 @@ export async function runVitestBatch(params) {
|
16 | 16 | cwd: repoRoot, |
17 | 17 | detached: shouldUseDetachedVitestProcessGroup(), |
18 | 18 | env: params.env, |
19 | | -pnpmArgs: [ |
20 | | -"exec", |
21 | | -"vitest", |
22 | | -"run", |
23 | | -"--config", |
24 | | -params.config, |
25 | | - ...params.targets, |
26 | | - ...params.args, |
27 | | -], |
| 19 | +pnpmArgs: buildVitestBatchPnpmArgs(params), |
28 | 20 | stdio: "inherit", |
29 | 21 | }); |
30 | 22 | const teardownChildCleanup = installVitestProcessGroupCleanup({ child }); |
@@ -44,6 +36,10 @@ export async function runVitestBatch(params) {
|
44 | 36 | }); |
45 | 37 | } |
46 | 38 | |
| 39 | +export function buildVitestBatchPnpmArgs(params) { |
| 40 | +return ["exec", "vitest", "run", "--config", params.config, ...params.args, ...params.targets]; |
| 41 | +} |
| 42 | + |
47 | 43 | export function isDirectScriptRun(metaUrl) { |
48 | 44 | const entryHref = process.argv[1] ? pathToFileURL(path.resolve(process.argv[1])).href : ""; |
49 | 45 | return metaUrl === entryHref; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,6 +13,7 @@ import {
|
13 | 13 | resolveExtensionBatchPlan, |
14 | 14 | resolveExtensionTestPlan, |
15 | 15 | } from "../../scripts/lib/extension-test-plan.mjs"; |
| 16 | +import { buildVitestBatchPnpmArgs } from "../../scripts/lib/vitest-batch-runner.mjs"; |
16 | 17 | import { |
17 | 18 | parseExtensionIds, |
18 | 19 | resolveExtensionBatchParallelism, |
@@ -606,6 +607,25 @@ describe("scripts/test-extension.mjs", () => {
|
606 | 607 | }); |
607 | 608 | }); |
608 | 609 | |
| 610 | +it("places Vitest passthrough options before batch target roots", () => { |
| 611 | +expect( |
| 612 | +buildVitestBatchPnpmArgs({ |
| 613 | +args: ["--exclude", "extensions/codex/src/app-server/run-attempt.test.ts"], |
| 614 | +config: "test/vitest/vitest.extensions.config.ts", |
| 615 | +targets: ["extensions/codex"], |
| 616 | +}), |
| 617 | +).toEqual([ |
| 618 | +"exec", |
| 619 | +"vitest", |
| 620 | +"run", |
| 621 | +"--config", |
| 622 | +"test/vitest/vitest.extensions.config.ts", |
| 623 | +"--exclude", |
| 624 | +"extensions/codex/src/app-server/run-attempt.test.ts", |
| 625 | +"extensions/codex", |
| 626 | +]); |
| 627 | +}); |
| 628 | + |
609 | 629 | it("treats extensions without tests as a no-op by default", () => { |
610 | 630 | const extensionId = findExtensionWithoutTests(); |
611 | 631 | const stdout = runScript([extensionId]); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。