惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
MyScale Blog
MyScale Blog
Recent Announcements
Recent Announcements
N
Netflix TechBlog - Medium
GbyAI
GbyAI
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
Martin Fowler
Martin Fowler
腾讯CDC
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
J
Java Code Geeks
WordPress大学
WordPress大学
P
Proofpoint News Feed
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(test): defer unit coverage source discovery · opencla...
vincentkoc · 2026-05-16 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -132,9 +132,21 @@ describe("unit vitest config", () => {

132132

expect(testConfig.exclude).toContain("src/security/**");

133133

});

134134
135-

it("scopes default coverage to source files owned by the unit lane", () => {

135+

it("skips default coverage source discovery when coverage is disabled", () => {

136136

const unitConfig = createUnitVitestConfig({});

137137

const testConfig = requireTestConfig(unitConfig);

138+
139+

expect(testConfig.coverage?.include).toBeUndefined();

140+

});

141+
142+

it("scopes default coverage to source files owned by the unit lane", () => {

143+

const unitConfig = createUnitVitestConfigWithOptions(

144+

{},

145+

{

146+

argv: ["node", "vitest", "run", "--coverage"],

147+

},

148+

);

149+

const testConfig = requireTestConfig(unitConfig);

138150

const coverageInclude = testConfig.coverage?.include;

139151

expect(coverageInclude).toContain("src/commitments/runtime.ts");

140152

expect(coverageInclude).toContain("src/media-generation/runtime-shared.ts");

Original file line numberDiff line numberDiff line change

@@ -84,6 +84,20 @@ export function resolveDefaultUnitCoverageIncludePatterns(

8484

return [...sourceFiles].toSorted((left, right) => left.localeCompare(right));

8585

}

8686
87+

function isEnabledFlagValue(value: string): boolean {

88+

return !["0", "false", "no", "off"].includes(value.trim().toLowerCase());

89+

}

90+
91+

function isCoverageEnabledFromArgv(argv: string[] = process.argv): boolean {

92+

return argv.some((arg) => {

93+

if (arg === "--coverage" || arg === "--coverage.enabled") {

94+

return true;

95+

}

96+

const match = arg.match(/^--coverage(?:\.enabled)?=(.*)$/u);

97+

return match ? isEnabledFlagValue(match[1] ?? "") : false;

98+

});

99+

}

100+
87101

export function createUnitVitestConfigWithOptions(

88102

env: Record<string, string | undefined> = process.env,

89103

options: {

@@ -95,11 +109,13 @@ export function createUnitVitestConfigWithOptions(

95109

} = {},

96110

) {

97111

const isolate = resolveVitestIsolation(env);

112+

const argv = options.argv ?? process.argv;

98113

const unitFastTestFiles = getUnitFastTestFiles();

99114

const envIncludePatterns = loadIncludePatternsFromEnv(env);

100115

const defaultIncludePatterns = options.includePatterns ?? unitTestIncludePatterns;

101-

const cliIncludePatterns = narrowIncludePatternsForCli(defaultIncludePatterns, options.argv);

116+

const cliIncludePatterns = narrowIncludePatternsForCli(defaultIncludePatterns, argv);

102117

const coverageIncludePatterns =

118+

isCoverageEnabledFromArgv(argv) &&

103119

options.includePatterns === undefined &&

104120

envIncludePatterns === null &&

105121

cliIncludePatterns === null