Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(ci): retain deferred client test import coverage (#13388)

[._.]/ Adam Eivyccfea52ace39
diff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.js
index 24394ba102..d8dcd87769 100644
--- a/scripts/ci-test-plan.js
+++ b/scripts/ci-test-plan.js
@@ -1081,7 +1081,7 @@ function buildSuitePlan(changedFiles, {
// Repository-derived browser dependencies; null means discovery failed and
// a shared-source change must retain conservative full coverage.
clientDependencies = [],
- // Client test → static shared dependencies; null conservatively retains that test.
+ // Client test → shared dependencies; null conservatively retains that test.
// Kept separate from production dependencies so fixtures never force a build.
clientTestDependencies = {},
// Includes literal deferred imports; null means discovery was inconclusive.
@@ -1703,14 +1703,14 @@ export function collectPlanInputs({ baseSha, forceFull = false, changedFiles, cw
? collectClientDependencies(dependencyFiles, snapshot)
: [];
- // Static imports and re-exports include test fixtures, unlike the production
- // projection. Keep uncertainty per test so one unresolved fixture cannot
- // widen every resolved consumer, and reuse this collection's source snapshot.
+ // Include test fixtures and literal deferred imports, unlike the production
+ // projection. Keep uncertainty per test so one unresolved/computed fixture
+ // retains its consumer without widening every resolved test.
const clientTestDependencies = collectedChangedFiles.some((path) => isSharedClientDependency(path)
&& isExecutable(path) && !isTestFile(path))
? Object.fromEntries(dependencyFiles.filter((path) => path.startsWith('client/src/')
&& isTestFile(path)).map((test) => [test,
- collectTestDependencies([test], snapshot.staticDependencies)?.filter(isSharedClientDependency) ?? null]))
+ collectTestDependencies([test], snapshot.testDependencies)?.filter(isSharedClientDependency) ?? null]))
: {};
const hasRelatedServerSource = collectedChangedFiles.some((path) => isServerRunnerFile(path)
diff --git a/scripts/ci-test-plan.test.js b/scripts/ci-test-plan.test.js
index 481105ef7a..ff0305fe2d 100644
--- a/scripts/ci-test-plan.test.js
+++ b/scripts/ci-test-plan.test.js
@@ -396,7 +396,7 @@ it('projects test-only shared re-exports and retains unresolved consumers withou
write(unused, 'export const unused = 1;\n');
write('scripts/lib/cleanupBridge.js', "export { value } from './cleanupLeaf.js';\n");
write('client/src/test/fixture.js', "export { value } from '../../../scripts/lib/cleanupBridge.js';\n");
- write(consumer, "import './fixture.js';\n");
+ write(consumer, "const fixture = await import('./fixture.js');\n");
write(unrelated, 'export const unrelated = 1;\n');
git('add', '--all');
@@ -407,6 +407,10 @@ it('projects test-only shared re-exports and retains unresolved consumers withou
write('client/src/test/fixture.js', "export { value } from './missing.js';\n");
expect(plan(leaf)).toMatchObject({ full: false, build: false,
client_mode: 'files', client_files: JSON.stringify([consumer]) });
+
+ write(consumer, "const fixture = await import(globalThis.fixturePath);\n");
+ expect(plan(leaf)).toMatchObject({ full: false, build: false,
+ client_mode: 'files', client_files: JSON.stringify([consumer]) });
} finally {
rmSync(root, { recursive: true, force: true });
}