diff --git a/.github/scripts/release-pipeline.ts b/.github/scripts/release-pipeline.ts index d9d04f161..ba397c61c 100644 --- a/.github/scripts/release-pipeline.ts +++ b/.github/scripts/release-pipeline.ts @@ -626,7 +626,7 @@ export function retagMajor(options: RetagMajorOptions): RetaggedMajor { return { major, packagedSha, move }; } -/** checks.yml's head_ref conditions spell this by hand; test/docs/checks-workflow.test.ts pins them to it. */ +/** checks.yml's head_ref conditions spell this by hand; test/workflows/checks-workflow.test.ts pins them to it. */ export const RELEASE_PR_BRANCH_PREFIX = "release-please--"; const RELEASE_PR_BRANCH = `${RELEASE_PR_BRANCH_PREFIX}branches--main`; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f26974062..8500d45ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ The fleet-wide conventions - Conventional Commit titles, squash merges, the `all - Every temp directory a test creates is removed on every exit path, failure included: `withTempDir()` from `test/temp-dir.ts`, or a try/finally of its own. A fixture that outlives one test removes its dir when it ends (the release-pipeline fixture in afterAll, the e2e bundle on process exit). - An Io a test records through is `captureIo()` from `test/io/capture.ts`: every channel in its own list and in one ordered event log. - A repository-relative path in a test resolves from `ROOT` in `test/root.ts`; a file beside the test resolves from `import.meta.dir`. -- A test in `test/docs` guards an invariant between artifacts (a doc's claim against the code, a workflow against the constant a script prints); a pin of one file's own text is not kept. +- A test in `test/docs`, `test/workflows`, or `test/config` guards an invariant between artifacts (a doc's claim against the code, a workflow against the constant a script prints); a pin of one file's own text is not kept. ## End-to-end tests diff --git a/COVERAGE.md b/COVERAGE.md deleted file mode 100644 index 72306d1b2..000000000 --- a/COVERAGE.md +++ /dev/null @@ -1,3 +0,0 @@ -# Coverage - -The coverage page moved to [docs/reference/coverage.md](docs/reference/coverage.md). diff --git a/test/docs/biome-schema.test.ts b/test/config/biome-schema.test.ts similarity index 100% rename from test/docs/biome-schema.test.ts rename to test/config/biome-schema.test.ts diff --git a/test/docs/issue-templates.test.ts b/test/config/issue-templates.test.ts similarity index 100% rename from test/docs/issue-templates.test.ts rename to test/config/issue-templates.test.ts diff --git a/test/package-json.test.ts b/test/config/package-json.test.ts similarity index 96% rename from test/package-json.test.ts rename to test/config/package-json.test.ts index ec9691708..3c4e9eccc 100644 --- a/test/package-json.test.ts +++ b/test/config/package-json.test.ts @@ -8,11 +8,11 @@ import { readFileSync } from "node:fs"; import { dirname, join, resolve } from "node:path"; import { parseSync } from "oxc-parser"; import { parse as parseYaml } from "yaml"; -import manifest from "../.release-please-manifest.json"; -import pkg from "../package.json"; -import tsdown from "../tsdown.config.js"; -import { ROOT } from "./root.js"; -import { readSettingsSchema } from "./settings-schema.js"; +import manifest from "../../.release-please-manifest.json"; +import pkg from "../../package.json"; +import tsdown from "../../tsdown.config.js"; +import { ROOT } from "../root.js"; +import { readSettingsSchema } from "../settings-schema.js"; const schema = readSettingsSchema(); diff --git a/test/package-pins.test.ts b/test/config/package-pins.test.ts similarity index 97% rename from test/package-pins.test.ts rename to test/config/package-pins.test.ts index ee2a58e05..28fe55338 100644 --- a/test/package-pins.test.ts +++ b/test/config/package-pins.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import pkg from "../package.json"; +import pkg from "../../package.json"; // A from-scratch `bun install` (nightly's float-canary) honors every range in package.json, so a range specifier floats there untested against // main (zod ^4.4.3 floating to 4.5.4 broke every open Dependabot PR when a lockfile-regenerating workflow still existed). Exact pins leave only diff --git a/test/docs/guides.test.ts b/test/docs/guides.test.ts index 0774c4888..4b127f4fa 100644 --- a/test/docs/guides.test.ts +++ b/test/docs/guides.test.ts @@ -169,7 +169,7 @@ const SITE_ROOT = "/docs-root-7c1e/"; /** * Relative links in the docs/ page at `page` that resolve outside docs/. * Resolution is the WHATWG URL parser's, as a browser does it; the published site is built from docs/ alone, so a link - * to the README, COVERAGE.md, or lib/ has nothing to land on there. + * to the README, CONTRIBUTING.md, or lib/ has nothing to land on there. */ async function linksLeavingDocs(markdown: string, page: string): Promise { const base = new URL(`${SITE_ROOT}${page}`, SITE_ORIGIN); @@ -338,7 +338,6 @@ describe("docs/ guide pages", () => { const linkScanFiles = () => [ ...guidePages().map((page) => ({ label: `docs/${page}`, path: join(DOCS, page) })), { label: "README.md", path: join(ROOT, "README.md") }, - { label: "COVERAGE.md", path: join(ROOT, "COVERAGE.md") }, { label: "CONTRIBUTING.md", path: join(ROOT, "CONTRIBUTING.md") }, { label: ".github/SECURITY.md", path: join(ROOT, ".github", "SECURITY.md") }, ]; @@ -363,7 +362,7 @@ describe("docs/ guide pages", () => { expect(orphans, "no README, guide, or root page links these docs/ pages").toEqual([]); }); - test("every relative link in the guides, README, and COVERAGE resolves to a real file", () => { + test("every relative link in the guides, README, and CONTRIBUTING resolves to a real file", () => { const broken: string[] = []; for (const file of linkScanFiles()) { const markdown = linesOutsideFences(readFileSync(file.path, "utf8"), file.label).join("\n"); @@ -880,16 +879,16 @@ describe("links-leaving-docs guard (mutation checks)", () => { "# not a link: [x](../../README.md)", "```", "", - "[COVERAGE](../../COVERAGE.md), [site](https://example.com/../x), [here](#title), `[code](../../README.md)`.", + "[ROADMAP](../../ROADMAP.md), [site](https://example.com/../x), [here](#title), `[code](../../README.md)`.", "", - "Reference-style: [the README][root], [semantics][sem], [schema][schema], [coverage][cov], and [two", + "Reference-style: [the README][root], [semantics][sem], [schema][schema], [roadmap][road], and [two", "lines][two lines].", "", "[root]: ../../README.md#sections", "[sem]: ../reference/semantics.md", "[schema]: <../../lib/settings.schema.json>", - "[cov]:", - "../../COVERAGE.md#supported 'Coverage'", + "[road]:", + "../../ROADMAP.md#supported 'Roadmap'", "[two", "lines]: ../../SECURITY.md", "", @@ -920,10 +919,10 @@ describe("links-leaving-docs guard (mutation checks)", () => { test("names each escaping link by page and line", async () => { expect(await linksLeavingDocs(page, "start/getting-started.md")).toEqual([ "docs/start/getting-started.md:3: (../../README.md#sections) leaves docs/", - "docs/start/getting-started.md:9: (../../COVERAGE.md) leaves docs/", + "docs/start/getting-started.md:9: (../../ROADMAP.md) leaves docs/", "docs/start/getting-started.md:3: (../../README.md#sections) leaves docs/", "docs/start/getting-started.md:16: (../../lib/settings.schema.json) leaves docs/", - "docs/start/getting-started.md:18: (../../COVERAGE.md#supported) leaves docs/", + "docs/start/getting-started.md:18: (../../ROADMAP.md#supported) leaves docs/", "docs/start/getting-started.md:20: (../../SECURITY.md) leaves docs/", "docs/start/getting-started.md:3: (../../README.md) leaves docs/", "docs/start/getting-started.md:23: (../../CONTRIBUTING.md) leaves docs/", diff --git a/test/e2e/constants.ts b/test/e2e/constants.ts index 0a1b53c60..326a09e23 100644 --- a/test/e2e/constants.ts +++ b/test/e2e/constants.ts @@ -8,7 +8,7 @@ import { ROOT } from "../root.js"; /** * Where the runner dumps a failing scenario's replay bundle. Workflow yaml cannot import this, so the upload steps - * spell the path by hand; test/docs/nightly-workflows.test.ts holds them to it. + * spell the path by hand; test/workflows/nightly-workflows.test.ts holds them to it. */ export const ARTIFACTS_DIR = join(ROOT, "test", "e2e", ".artifacts"); diff --git a/test/docs/checks-workflow.test.ts b/test/workflows/checks-workflow.test.ts similarity index 100% rename from test/docs/checks-workflow.test.ts rename to test/workflows/checks-workflow.test.ts diff --git a/test/docs/head-ref.ts b/test/workflows/head-ref.ts similarity index 100% rename from test/docs/head-ref.ts rename to test/workflows/head-ref.ts diff --git a/test/docs/nightly-workflows.test.ts b/test/workflows/nightly-workflows.test.ts similarity index 100% rename from test/docs/nightly-workflows.test.ts rename to test/workflows/nightly-workflows.test.ts diff --git a/test/docs/npm-publish-workflows.test.ts b/test/workflows/npm-publish-workflows.test.ts similarity index 100% rename from test/docs/npm-publish-workflows.test.ts rename to test/workflows/npm-publish-workflows.test.ts diff --git a/test/docs/post-green-workflow.test.ts b/test/workflows/post-green-workflow.test.ts similarity index 100% rename from test/docs/post-green-workflow.test.ts rename to test/workflows/post-green-workflow.test.ts diff --git a/test/docs/repo-owned-workflows.test.ts b/test/workflows/repo-owned-workflows.test.ts similarity index 100% rename from test/docs/repo-owned-workflows.test.ts rename to test/workflows/repo-owned-workflows.test.ts diff --git a/test/docs/workflow-loader.ts b/test/workflows/workflow-loader.ts similarity index 95% rename from test/docs/workflow-loader.ts rename to test/workflows/workflow-loader.ts index c02a6d08b..86b0d0ce8 100644 --- a/test/docs/workflow-loader.ts +++ b/test/workflows/workflow-loader.ts @@ -1,5 +1,5 @@ /** - * One reader for the workflow YAML the docs tests pin, and the parsed shapes. + * One reader for the workflow YAML the workflow tests pin, and the parsed shapes. */ import { readdirSync, readFileSync } from "node:fs";