History

fix(ci): cover cross-surface server test inputs

t3-code[bot] committed 2 months ago

Commit 25c2b2f1 parent a096eb82 files · +17 −1Browse files

Showing the changes to .github (2 of 2 files). Show all

Unified · Split

2 files
  1. .github/scripts/ci-change-classifier.cjs +6 −0
  2. .github/scripts/ci-change-classifier.test.cjs +11 −1
.github/scripts/ci-change-classifier.cjs+6−0
@@ -32,6 +32,11 @@ const SERVER_TEST_PACKAGE_ROOTS = [ · 31 unmodified lines
32 "packages/shared/",32 "packages/shared/",
33 "packages/tailscale/",33 "packages/tailscale/",
34];34];
35const SERVER_TEST_EXACT_INPUTS = new Set([
36 "apps/mobile/src/lib/threadActivity.ts",
37 "apps/web/src/lib/contextWindow.ts",
38 "apps/web/src/session-logic.ts",
39]);
35const MOBILE_NATIVE_EXACT_INPUTS = new Set([40const MOBILE_NATIVE_EXACT_INPUTS = new Set([
36 ".editorconfig",41 ".editorconfig",
37 "apps/.editorconfig",42 "apps/.editorconfig",
@@ -190,6 +195,7 @@ function isServerTestInput(file) { · 152 unmodified lines
190 return false;195 return false;
191 }196 }
192 if (isWorkspaceNodeInput(file)) return true;197 if (isWorkspaceNodeInput(file)) return true;
198 if (SERVER_TEST_EXACT_INPUTS.has(file)) return true;
193 if (file.startsWith("apps/server/") || file.startsWith("scripts/")) return true;199 if (file.startsWith("apps/server/") || file.startsWith("scripts/")) return true;
194 if (SERVER_TEST_PACKAGE_ROOTS.some((root) => file.startsWith(root))) return true;200 if (SERVER_TEST_PACKAGE_ROOTS.some((root) => file.startsWith(root))) return true;
195 if (201 if (
.github/scripts/ci-change-classifier.test.cjs+11−1
@@ -80,7 +80,17 @@ test("runs both node test groups for shared server dependencies", () => { · 79 unmodified lines
80 }80 }
81});81});
82 82
83test("keeps client-only packages off the server shards", () => {83test("runs server shards for cross-surface modules imported by server tests", () => {
84 for (const file of [
85 "apps/web/src/lib/contextWindow.ts",
86 "apps/web/src/session-logic.ts",
87 "apps/mobile/src/lib/threadActivity.ts",
88 ]) {
89 assert.equal(classifyChangedPaths([file]).testServer, true, file);
90 }
91});
92
93test("keeps unrelated client-only packages off the server shards", () => {
84 for (const file of [94 for (const file of [
85 "apps/desktop/src/main.ts",95 "apps/desktop/src/main.ts",
86 "apps/mobile/src/app.tsx",96 "apps/mobile/src/app.tsx",