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
2 changes: 1 addition & 1 deletion .github/scripts/release-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions COVERAGE.md

This file was deleted.

File renamed without changes.
10 changes: 5 additions & 5 deletions test/package-json.test.ts → test/config/package-json.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 8 additions & 9 deletions test/docs/guides.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string[]> {
const base = new URL(`${SITE_ROOT}${page}`, SITE_ORIGIN);
Expand Down Expand Up @@ -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") },
];
Expand All @@ -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");
Expand Down Expand Up @@ -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",
"",
Expand Down Expand Up @@ -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/",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
Loading