refactor: canonicalize aliases and classify test suites (#122407)

* refactor: use canonical re-export names

* fix(test): classify suite support as test source

* fix(agents): retarget gateway stub session-entry import

* test(gateway): retarget session-utils mock keys after alias removal
This commit is contained in:
Peter Steinberger
2026-08-11 21:18:34 -07:00
committed by GitHub
parent 6b0be0215f
commit f6fff4f7fd
63 changed files with 191 additions and 149 deletions
+2 -2
View File
@@ -23,9 +23,9 @@ const SURFACE_PATTERNS = [
["legacyRootAsset", /^assets\//u],
];
const CHANGED_LANE_TEST_PATH_RE =
/(?:^|\/)(?:test|__tests__)\/|(?:\.|\/)(?:test|spec|e2e|browser\.test)\.[cm]?[jt]sx?$|(?:^|\/)[^/]+\.test-(?:helpers|support)\.[cm]?[jt]sx?$/u;
/(?:^|\/)(?:test|__tests__)\/|(?:\.|\/)(?:test|spec|suite|e2e|browser\.test)\.[cm]?[jt]sx?$|(?:^|\/)[^/]+\.test-(?:helpers|support)\.[cm]?[jt]sx?$/u;
const TEST_ONLY_PATH_RE =
/(^test\/|\/test\/|\/tests\/|(?:^|\/)[^/]+\.(?:test|spec|test-utils|test-(?:helpers|support|harness)|e2e-harness)\.[cm]?[jt]sx?$)/u;
/(^test\/|\/test\/|\/tests\/|(?:^|\/)[^/]+\.(?:test|spec|suite|test-utils|test-(?:helpers|support|harness)|e2e-harness)\.[cm]?[jt]sx?$)/u;
const NATIVE_ONLY_PATH_RE =
/^(?:apps\/android\/|apps\/ios\/|apps\/macos\/|apps\/macos-mlx-tts\/|apps\/shared\/|apps\/swabble\/|Swabble\/|appcast\.xml$)/u;
+6 -1
View File
@@ -6,6 +6,7 @@ import {
findUnmatchedExplicitTestTargets,
hasImportGraphImpactOnTargets,
isTestFileTarget,
isTestSupportFileTarget,
resolveChangedTestTargetPlan,
} from "../test-projects.test-support.mts";
import {
@@ -53,7 +54,11 @@ const splitNodeTestConfigs = new Set(
);
function isTestOnlyPath(changedPath: string) {
return isTestFileTarget(changedPath) || changedPath.startsWith("test/");
return (
isTestFileTarget(changedPath) ||
isTestSupportFileTarget(changedPath) ||
changedPath.startsWith("test/")
);
}
// Inputs `build:ci-artifacts` consumes: runtime/plugin/package sources plus
+2 -2
View File
@@ -1000,12 +1000,12 @@ export function isTestFileTarget(arg: string) {
return /\.(?:test|spec)\.[cm]?[jt]sx?$/u.test(arg);
}
function isTestSupportFileTarget(arg: string) {
export function isTestSupportFileTarget(arg: string) {
if (/(?:^|\/)(?:test-helpers|test-support)(?:\/|$)/u.test(arg)) {
return true;
}
const basename = path.posix.basename(arg).replace(/\.[cm]?[jt]sx?$/u, "");
return /(?:^|[._-])test-(?:helpers|support)(?:[._-]|$)/u.test(basename);
return /(?:^|[._-])(?:suite|test-(?:helpers|support))(?:[._-]|$)/u.test(basename);
}
function isLikelyFileTarget(arg: string) {