fix(test): suppress rolldown timing noise · openclaw/openclaw@6d9b388
vincentkoc
·
2026-05-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,6 +7,7 @@ Docs: https://docs.openclaw.ai
|
7 | 7 | ### Changes |
8 | 8 | |
9 | 9 | ### Fixes |
| 10 | +- Tests: suppress the current Rolldown plugin timing warning format in the Vitest wrapper so tiny focused runs do not drown useful stderr in repeated build-timing noise. |
10 | 11 | - Crabbox: sync clean sparse-checkout remote changed gates from a temporary full checkout with local-only commits overlaid as worktree changes so git-backed script checks can seed the runner repository. |
11 | 12 | - Tests: make startup memory and startup bench smoke scripts build CLI startup artifacts when run from a fresh source checkout. |
12 | 13 | - iMessage: mark authorized slash-command turns as text-sourced commands so `/status`, `/new`, and `/restart` acknowledgements return to the source conversation. (#82642) thanks @homer-byte. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,9 @@ import {
|
10 | 10 | } from "./vitest-process-group.mjs"; |
11 | 11 | |
12 | 12 | const TRUTHY_ENV_VALUES = new Set(["1", "true", "yes", "on"]); |
13 | | -const SUPPRESSED_VITEST_STDERR_PATTERNS = ["[PLUGIN_TIMINGS] Warning:"]; |
| 13 | +const ANSI_CSI_PREFIX = `${String.fromCharCode(27)}[`; |
| 14 | +const ANSI_CSI_SUFFIX_RE = /^[0-?]*[ -/]*[@-~]/u; |
| 15 | +const SUPPRESSED_VITEST_STDERR_PATTERNS = ["[PLUGIN_TIMINGS]"]; |
14 | 16 | const require = createRequire(import.meta.url); |
15 | 17 | |
16 | 18 | function isTruthyEnvValue(value) { |
@@ -79,7 +81,11 @@ function resolveExplicitVitestWorkerBudget(env) {
|
79 | 81 | } |
80 | 82 | |
81 | 83 | export function shouldSuppressVitestStderrLine(line) { |
82 | | -return SUPPRESSED_VITEST_STDERR_PATTERNS.some((pattern) => line.includes(pattern)); |
| 84 | +const normalizedLine = line |
| 85 | +.split(ANSI_CSI_PREFIX) |
| 86 | +.map((segment, index) => (index === 0 ? segment : segment.replace(ANSI_CSI_SUFFIX_RE, ""))) |
| 87 | +.join(""); |
| 88 | +return SUPPRESSED_VITEST_STDERR_PATTERNS.some((pattern) => normalizedLine.includes(pattern)); |
83 | 89 | } |
84 | 90 | |
85 | 91 | export function resolveDirectNodeVitestArgs(pnpmArgs) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -132,6 +132,11 @@ describe("scripts/run-vitest", () => {
|
132 | 132 | "\u001b[33m[PLUGIN_TIMINGS] Warning:\u001b[0m plugin `foo` was slow\n", |
133 | 133 | ), |
134 | 134 | ).toBe(true); |
| 135 | +expect( |
| 136 | +shouldSuppressVitestStderrLine( |
| 137 | +"\u001b[33m[PLUGIN_TIMINGS] \u001b[0mYour build spent significant time in plugin `externalize-deps`.\n", |
| 138 | +), |
| 139 | +).toBe(true); |
135 | 140 | expect(shouldSuppressVitestStderrLine("real failure output\n")).toBe(false); |
136 | 141 | }); |
137 | 142 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。