Skip to content

Commit 58f954e

Browse files
fix(ci): the fork's changed-file check leaves tests to the test jobs
A large merge puts over a thousand test files beside its changes, which one step cannot finish inside its 900 s limit. check:changed gains --skip-tests, and the fork job passes it because the shard jobs already run the suites. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 21ff7b2 commit 58f954e

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎.github/workflows/fork-ci.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ jobs:
8080
run: node apps/web/node_modules/playwright/cli.js install --with-deps --only-shell chromium
8181
- name: Validate changed files
8282
if: github.event_name == 'pull_request'
83-
run: vp run check:changed HEAD^1 --concurrency 1
83+
# The test jobs run the full suites; a large merge has too many tests beside changes for one step.
84+
run: vp run check:changed HEAD^1 --concurrency 1 --skip-tests
8485
- name: Validate full repository
8586
if: github.event_name != 'pull_request'
8687
run: |

‎scripts/check-changed.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ const checkChanged = Effect.fn("checkChanged")(function* (input: {
270270
readonly ref: Option.Option<string>;
271271
readonly concurrency: Option.Option<number>;
272272
readonly timeout: Option.Option<number>;
273+
readonly skipTests: boolean;
273274
}) {
274275
const fs = yield* FileSystem.FileSystem;
275276
const path = yield* Path.Path;
@@ -593,7 +594,7 @@ const checkChanged = Effect.fn("checkChanged")(function* (input: {
593594
return isMemoryTest(file) ? needsMemory(step) : step;
594595
}),
595596
// From the repo root, the root vite.config.ts hands each file to its package's config.
596-
...(vitestTests.length > 0
597+
...(vitestTests.length > 0 && !input.skipTests
597598
? [
598599
{
599600
...(serverTests ? needsMemory(vitestStep) : vitestStep),
@@ -649,6 +650,8 @@ const checkChanged = Effect.fn("checkChanged")(function* (input: {
649650
if (ciOnly.length > 0) summary.push(` CI also runs: ${ciOnly.join(", ")}`);
650651
if (!runPatchCheck) summary.push(" unused patch check skipped: no dependency files changed");
651652
if (!runKnip) summary.push(" knip skipped: no code or manifest changed");
653+
if (input.skipTests && vitestTests.length > 0)
654+
summary.push(` tests skipped: --skip-tests left ${vitestTests.length} files to the test jobs`);
652655
yield* Console.log(`\n${summary.join("\n")}`);
653656

654657
if (results.some((result) => result.outcome !== "pass")) return false;
@@ -685,6 +688,12 @@ export const checkChangedCommand = Command.make(
685688
),
686689
Flag.optional,
687690
),
691+
skipTests: Flag.Boolean("skip-tests").pipe(
692+
Flag.withDescription(
693+
"Skip the tests beside changes, for CI where the test jobs run the full suites.",
694+
),
695+
Flag.withDefault(false),
696+
),
688697
},
689698
(input) =>
690699
checkChanged(input).pipe(

0 commit comments

Comments
 (0)