mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(test): suppress rolldown timing noise
This commit is contained in:
@@ -7,6 +7,7 @@ Docs: https://docs.openclaw.ai
|
||||
### Changes
|
||||
|
||||
### Fixes
|
||||
- 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.
|
||||
- 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.
|
||||
- Tests: make startup memory and startup bench smoke scripts build CLI startup artifacts when run from a fresh source checkout.
|
||||
- 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.
|
||||
|
||||
@@ -10,7 +10,9 @@ import {
|
||||
} from "./vitest-process-group.mjs";
|
||||
|
||||
const TRUTHY_ENV_VALUES = new Set(["1", "true", "yes", "on"]);
|
||||
const SUPPRESSED_VITEST_STDERR_PATTERNS = ["[PLUGIN_TIMINGS] Warning:"];
|
||||
const ANSI_CSI_PREFIX = `${String.fromCharCode(27)}[`;
|
||||
const ANSI_CSI_SUFFIX_RE = /^[0-?]*[ -/]*[@-~]/u;
|
||||
const SUPPRESSED_VITEST_STDERR_PATTERNS = ["[PLUGIN_TIMINGS]"];
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
function isTruthyEnvValue(value) {
|
||||
@@ -79,7 +81,11 @@ function resolveExplicitVitestWorkerBudget(env) {
|
||||
}
|
||||
|
||||
export function shouldSuppressVitestStderrLine(line) {
|
||||
return SUPPRESSED_VITEST_STDERR_PATTERNS.some((pattern) => line.includes(pattern));
|
||||
const normalizedLine = line
|
||||
.split(ANSI_CSI_PREFIX)
|
||||
.map((segment, index) => (index === 0 ? segment : segment.replace(ANSI_CSI_SUFFIX_RE, "")))
|
||||
.join("");
|
||||
return SUPPRESSED_VITEST_STDERR_PATTERNS.some((pattern) => normalizedLine.includes(pattern));
|
||||
}
|
||||
|
||||
export function resolveDirectNodeVitestArgs(pnpmArgs) {
|
||||
|
||||
@@ -132,6 +132,11 @@ describe("scripts/run-vitest", () => {
|
||||
"\u001b[33m[PLUGIN_TIMINGS] Warning:\u001b[0m plugin `foo` was slow\n",
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
shouldSuppressVitestStderrLine(
|
||||
"\u001b[33m[PLUGIN_TIMINGS] \u001b[0mYour build spent significant time in plugin `externalize-deps`.\n",
|
||||
),
|
||||
).toBe(true);
|
||||
expect(shouldSuppressVitestStderrLine("real failure output\n")).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user