Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ jobs:
- run: npx hereby test:extension
- run: npx hereby test:tools
- run: npx hereby test:api
Comment thread
jakebailey marked this conversation as resolved.
- 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' }}
Expand Down
19 changes: 16 additions & 3 deletions Herebyfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Comment thread
weswigham marked this conversation as resolved.
run: runTestBenchmarks,
});

Expand All @@ -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.",
Expand Down Expand Up @@ -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.",
Expand All @@ -1273,6 +1286,7 @@ export const testAll = task({
await runTestBenchmarks();
await runTestTools();
await runTestAPI();
await runTestAPIBenchmarks();
},
});

Expand Down Expand Up @@ -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.",
Comment thread
weswigham marked this conversation as resolved.
Comment thread
jakebailey marked this conversation as resolved.
dependencies: [build],
run: async () => {
/** @type {{ name: string; error: unknown }[]} */
Expand Down Expand Up @@ -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`
}
Expand Down
5 changes: 0 additions & 5 deletions packages/typescript/test/async/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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({
Expand Down
5 changes: 0 additions & 5 deletions packages/typescript/test/sync/api-generators.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -1778,7 +1777,3 @@ describe("API - generator batching", () => {
}
});
});

test("Generator benchmarks", () => {
runBenchmarks({ singleIteration: true });
});
5 changes: 0 additions & 5 deletions packages/typescript/test/sync/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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({
Expand Down
Loading