From d87e87352c882f0173a58895a27e2f22b73025ce Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 18 Sep 2026 18:41:04 -0700 Subject: [PATCH] Stop including API benchmarks in validate --- .github/workflows/ci.yml | 1 + Herebyfile.mjs | 19 ++++++++++++++++--- packages/typescript/test/async/api.test.ts | 5 ----- .../test/sync/api-generators.test.ts | 5 ----- packages/typescript/test/sync/api.test.ts | 5 ----- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1294fa195f6f3..fa4e75f4daf72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -214,6 +214,7 @@ jobs: - run: npx hereby test:extension - run: npx hereby test:tools - run: npx hereby test:api + - run: npx hereby test:benchmarks:api - run: git add . - uses: codecov/codecov-action@0b35c9ecc4f0529d0eb674914510c22f85b196b4 # v7.1.0 if: ${{ always() && matrix.config.coverage && github.event_name != 'merge_group' }} diff --git a/Herebyfile.mjs b/Herebyfile.mjs index dc15fc6fca1c0..86e7a14893130 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -1216,7 +1216,7 @@ async function runTestBenchmarks() { export const testBenchmarks = task({ name: "test:benchmarks", - description: "Runs all benchmarks.", + description: "Runs Go benchmarks once; excluded from validate.", run: runTestBenchmarks, }); @@ -1229,6 +1229,12 @@ async function runTestAPI() { await run("node", ["--conditions", "@typescript/source", "--test", "./test/**/*.test.ts"], { cwd: "./packages/typescript" }); } +async function runTestAPIBenchmarks() { + for (const variant of ["async", "sync", "generators"]) { + await run("node", ["--conditions", "@typescript/source", `./test/${variant}/api.bench.ts`, "--singleIteration"], { cwd: "./packages/typescript" }); + } +} + export const testTools = task({ name: "test:tools", description: "Runs all tests in the tools module.", @@ -1262,6 +1268,13 @@ export const testAPI = task({ run: runTestAPI, }); +export const testAPIBenchmarks = task({ + name: "test:benchmarks:api", + description: "Runs async, sync, and generator API benchmarks once; excluded from validate.", + dependencies: [tsgo, buildAPITests], + run: runTestAPIBenchmarks, +}); + export const testAll = task({ name: "test:all", description: "Runs ALL tests in the repo, including benchmarks, tools, and the API tests.", @@ -1273,6 +1286,7 @@ export const testAll = task({ await runTestBenchmarks(); await runTestTools(); await runTestAPI(); + await runTestAPIBenchmarks(); }, }); @@ -1401,7 +1415,7 @@ async function runFormat() { export const validate = task({ name: "validate", - description: "Builds, tests, lints, and formats the repo. Pass --api to include API tests, or --all to include all ancilliary repository tests.", + description: "Builds, tests, lints, and formats the repo. Pass --api to include API tests, or --all to include ancillary repository tests. Benchmarks are separate: test:benchmarks and test:benchmarks:api.", dependencies: [build], run: async () => { /** @type {{ name: string; error: unknown }[]} */ @@ -1429,7 +1443,6 @@ export const validate = task({ if (options.all) { await runGenerateExtension(); await runGenerateVendor(); - await runValidation("test:benchmarks", runTestBenchmarks); await runValidation("test:tools", runTestTools); await runValidation("test:smoke", runSmokeTest); // in CI this is run with `--race` } diff --git a/packages/typescript/test/async/api.test.ts b/packages/typescript/test/async/api.test.ts index b9abbda842993..30df57035e3f9 100644 --- a/packages/typescript/test/async/api.test.ts +++ b/packages/typescript/test/async/api.test.ts @@ -109,7 +109,6 @@ import { } from "node:test"; import { fileURLToPath } from "node:url"; import { isSignatureDeclaration } from "../../src/ast/is.ts"; -import { runBenchmarks } from "./api.bench.ts"; import { defaultFiles, spawnAPI, @@ -7361,10 +7360,6 @@ describe("Program - emit", () => { // @sync-skip-block-end }); -test("Benchmarks", async () => { - await runBenchmarks({ singleIteration: true }); -}); - describe("Timing", () => { test("collects combined client, server, and transport timing info", async () => { await using api = new API({ diff --git a/packages/typescript/test/sync/api-generators.test.ts b/packages/typescript/test/sync/api-generators.test.ts index 518eada991197..0560bd70bcc68 100644 --- a/packages/typescript/test/sync/api-generators.test.ts +++ b/packages/typescript/test/sync/api-generators.test.ts @@ -66,7 +66,6 @@ import { type APIRequestGenerator, executeRequestGenerators, } from "../../src/api/sync/generatorSupport.ts"; -import { runBenchmarks } from "../generators/api.bench.ts"; import { spawnAPI } from "./api.testUtils.ts"; const parityFiles = { @@ -1778,7 +1777,3 @@ describe("API - generator batching", () => { } }); }); - -test("Generator benchmarks", () => { - runBenchmarks({ singleIteration: true }); -}); diff --git a/packages/typescript/test/sync/api.test.ts b/packages/typescript/test/sync/api.test.ts index 0a18dc5a6eae0..b0328aaf317eb 100644 --- a/packages/typescript/test/sync/api.test.ts +++ b/packages/typescript/test/sync/api.test.ts @@ -117,7 +117,6 @@ import { } from "node:test"; import { fileURLToPath } from "node:url"; import { isSignatureDeclaration } from "../../src/ast/is.ts"; -import { runBenchmarks } from "./api.bench.ts"; import { defaultFiles, spawnAPI, @@ -7210,10 +7209,6 @@ describe("Program - emit", () => { }); }); -test("Benchmarks", () => { - runBenchmarks({ singleIteration: true }); -}); - describe("Timing", () => { test("collects combined client, server, and transport timing info", () => { using api = new API({