diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 8aea66d52..442b6d282 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -209,7 +209,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - shard: [1, 2, 3] + shard: [1, 2] steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -255,7 +255,7 @@ jobs: TMP: ${{ runner.temp }} TMPDIR: ${{ runner.temp }} CODEX_SECURITY_ALLOW_MACHINE_POLICY_TEST: "false" - run: node scripts/run-ci-tests.mjs ${{ matrix.shard }}/3 ${{ matrix.os == 'ubuntu-latest' && '--coverage --coverage-reporter=text --coverage-reporter=lcov' || '' }} + run: node scripts/run-ci-tests.mjs ${{ matrix.shard }}/2 ${{ matrix.os == 'ubuntu-latest' && '--coverage --coverage-reporter=text --coverage-reporter=lcov' || '' }} - name: Upload test reports if: always() continue-on-error: true @@ -431,7 +431,7 @@ jobs: strategy: fail-fast: false matrix: - shard: [1, 2, 3, 4, 5, 6, 7] + shard: [1, 2, 3, 4, 5, 6] steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -470,7 +470,7 @@ jobs: TMP: ${{ steps.windows-temp.outputs.path }} TMPDIR: ${{ steps.windows-temp.outputs.path }} CODEX_SECURITY_ALLOW_MACHINE_POLICY_TEST: "false" - run: node sdk/typescript/scripts/run-ci-tests.mjs ${{ matrix.shard }}/7 + run: node sdk/typescript/scripts/run-ci-tests.mjs ${{ matrix.shard }}/6 - name: Upload Windows test reports if: always() continue-on-error: true @@ -524,14 +524,10 @@ jobs: run: node scripts/check-package.mjs ../../dist/*.tgz windows: - name: windows-latest / node-${{ matrix.node == '22.13.0' && '22' || matrix.node }} + name: windows-latest / node-22 runs-on: ubuntu-latest if: always() needs: [validate-title, static-checks, windows-test, windows-verify] - strategy: - fail-fast: false - matrix: - node: ["22.13.0", "24"] steps: - name: Require every Windows coverage job if: needs.validate-title.result != 'success' || (needs.validate-title.outputs.ci-mode == 'full' && (needs.static-checks.result != 'success' || needs.windows-test.result != 'success' || needs.windows-verify.result != 'success')) || (needs.validate-title.outputs.ci-mode != 'full' && needs.validate-title.outputs.ci-mode != 'markdown') diff --git a/sdk/typescript/TESTING.md b/sdk/typescript/TESTING.md index 11a7c1074..82d7e1ad6 100644 --- a/sdk/typescript/TESTING.md +++ b/sdk/typescript/TESTING.md @@ -95,8 +95,8 @@ Typechecking and formatting run once in an independent required job, so package consumers do not wait for those checks. Package compilation and archive validation still finish before the test jobs start. -The full Bun suite runs once per OS under Node 22: three file shards on Linux -and macOS, and seven on Windows. The other Node versions run the installed +The full Bun suite runs once per OS under Node 22: two file shards on Linux +and macOS, and six on Windows. The other Node versions run the installed package checks instead of repeating the same Bun suite. MCP and Python tests run in separate required jobs. Python uses four isolated pytest-xdist workers with work stealing; worker crashes fail the run without automatic restarts. @@ -106,8 +106,8 @@ with work stealing; worker crashes fail the run without automatic restarts. Every new test file is included automatically with a one-second estimate. Refresh those estimates from the uploaded reports when adding or splitting expensive files; estimates affect scheduling, never whether a test runs. -To reproduce one Windows shard locally after building the plugin, run -`node scripts/run-ci-tests.mjs 3/7 --seed=12345`. +To reproduce one shard on Windows after building the plugin, run +`node scripts/run-ci-tests.mjs 3/6 --seed=12345`. Every Bun lane uploads JUnit; Linux lanes also upload LCOV per shard. Python reports include case durations, and the MCP runner can upload its JUnit report. diff --git a/sdk/typescript/tests-ts/release-automation.test.ts b/sdk/typescript/tests-ts/release-automation.test.ts index 2b6dde7ab..68c7438b5 100644 --- a/sdk/typescript/tests-ts/release-automation.test.ts +++ b/sdk/typescript/tests-ts/release-automation.test.ts @@ -4021,25 +4021,13 @@ describe("GitHub release workflow safeguards", () => { expect(workflow.jobs[gate]?.steps[0]?.run).toBe("exit 1"); } - const renderName = (template: string, values: Record) => { - let name = template; - for (const [key, value] of Object.entries(values)) { - name = name.replaceAll("${{ matrix." + key + " }}", value); - } - return name.replace( - "${{ matrix.node == '22.13.0' && '22' || matrix.node }}", - values["node"] === "22.13.0" ? "22" : values["node"] ?? "", - ); - }; const unixJob = workflow.jobs["required-test"]; const windowsJob = workflow.jobs["windows"]; const fullNames = [ ...(unixJob?.strategy?.matrix["os"] ?? []).map((os) => - renderName(unixJob?.name ?? "", { os }), - ), - ...(windowsJob?.strategy?.matrix["node"] ?? []).map((node) => - renderName(windowsJob?.name ?? "", { node }), + (unixJob?.name ?? "").replace("${{ matrix.os }}", os), ), + windowsJob?.name ?? "", ]; const requiredContexts = new Set([ "ubuntu-latest / node-22", diff --git a/sdk/typescript/tests-ts/skeleton.test.ts b/sdk/typescript/tests-ts/skeleton.test.ts index 5636217c8..22f736627 100644 --- a/sdk/typescript/tests-ts/skeleton.test.ts +++ b/sdk/typescript/tests-ts/skeleton.test.ts @@ -105,7 +105,7 @@ describe("TypeScript package skeleton", () => { const { jobs } = await workflow("node-ci.yml"); expect(jobs["test"]?.strategy?.matrix).toEqual({ os: ["ubuntu-latest", "macos-latest"], - shard: [1, 2, 3], + shard: [1, 2], }); expect(jobs["compatibility"]?.strategy?.matrix).toEqual({ os: ["ubuntu-latest"], @@ -113,7 +113,7 @@ describe("TypeScript package skeleton", () => { include: [{ os: "macos-latest", node: "22.13.0" }], }); expect(jobs["windows-test"]?.strategy?.matrix).toEqual({ - shard: [1, 2, 3, 4, 5, 6, 7], + shard: [1, 2, 3, 4, 5, 6], }); expect(jobs["windows-verify"]?.strategy?.matrix["node"]).toEqual([ "22.13.0", @@ -162,7 +162,7 @@ describe("TypeScript package skeleton", () => { expect(packageJson.scripts["test:ci"]).toContain("pnpm run test "); expect(jobs["windows-test"]?.steps).toContainEqual( expect.objectContaining({ - run: "node sdk/typescript/scripts/run-ci-tests.mjs ${{ matrix.shard }}/7", + run: "node sdk/typescript/scripts/run-ci-tests.mjs ${{ matrix.shard }}/6", }), ); });