From 16d1e486e015ec377b375e220890cc078f5e8bca Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 19 Aug 2026 07:20:50 -0700 Subject: [PATCH] fix(tests): scan broad test helper importers (#126325) --- scripts/test-projects.test-support.mts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/test-projects.test-support.mts b/scripts/test-projects.test-support.mts index f25aded89144..d59f99393642 100644 --- a/scripts/test-projects.test-support.mts +++ b/scripts/test-projects.test-support.mts @@ -1631,6 +1631,7 @@ function findDirectImportersWithGitGrep( ) { const tooling = options.tooling === true; const cacheKey = `${cwd}\0${tooling ? "tooling" : "source"}\0${importedFile}`; + const isTestHelper = importedFile.startsWith("test/helpers/"); if (cachedDirectImporters.has(cacheKey)) { return cachedDirectImporters.get(cacheKey) ?? null; } @@ -1650,7 +1651,8 @@ function findDirectImportersWithGitGrep( cachedDirectImporters.set(cacheKey, null); return null; } - if (candidates.length > 800) { + // Central test helpers intentionally fan out broadly; incomplete scans silently drop owning tests. + if (candidates.length > 800 && !isTestHelper) { skippedBroadTerm = true; continue; } @@ -1677,14 +1679,11 @@ function findDirectImportersWithGitGrep( } } } - if (importedFile.startsWith("test/helpers/") && importers.length > 0 && term.includes("/")) { + if (isTestHelper && importers.length > 0 && term.includes("/")) { break; } } - const result = - skippedBroadTerm && importers.length === 0 && !importedFile.startsWith("test/helpers/") - ? null - : importers; + const result = skippedBroadTerm && importers.length === 0 && !isTestHelper ? null : importers; cachedDirectImporters.set(cacheKey, result); return result; }