Skip to content
Myr

Let the deployed-web check open any project's file, so burrow's run can pass

Before adoption: this commit came in with the history the project adopted, so no landing records it.

- 914 runs `deployed.e2e.ts` with `WEB_PROJECT=burrow`, but the check opened datekit's `src/add.ts` and asked the code page for `src`: burrow has neither, so its run failed on those two pages whatever the web showed. - `WEB_FILE` names the file opened at `#L3` (default `src/add.ts`); the code page must list its root folder (`packages` for burrow's `packages/kit/src/http.ts`). Datekit's run is unchanged.

authored by oscabriel · committed by oscabriel · parent 0e4a6e9 · Browse files · 1 file+11 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−6 removed

  • other:+11 added−6 removed

1 file+11 added−6 removed

modified:apps/web/e2e/deployed.e2e.ts+11 added-6 removed
6 unmodified lines
7 *8 * It runs only against `WEB_URL` (a stage's web origin) and is skipped9 * without it. `WEB_PROJECT` and `WEB_ASK` pick the project and the ask10 * (datekit's format-ordinal, which the seed opens on every stage, unless11 * given). It only reads.11 * given), and `WEB_FILE` the file opened at line 3 (datekit's `src/add.ts`12 * unless given; its first folder is the one the code page must list, so13 * burrow's run names `packages/kit/src/http.ts`). It only reads.14 */15import { expect, test } from "@playwright/test";16import type { Page } from "@playwright/test";17import { Config, Effect, Option } from "effect";
4 unmodified lines
22 return {23 ask: yield* Config.NonEmptyString("WEB_ASK").pipe(24 Config.withDefault("format-ordinal")25 ),26 file: yield* Config.NonEmptyString("WEB_FILE").pipe(27 Config.withDefault("src/add.ts")28 ),29 project: yield* Config.NonEmptyString("WEB_PROJECT").pipe(30 Config.withDefault("datekit")31 ),32 web: Option.map(
3 unmodified lines
36 };37 })38);3935const { ask, project } = settings;40const { ask, file: FILE, project } = settings;4142/** The root folder `FILE` sits in, which the project's code page lists. */43const FOLDER = FILE.split("/")[0] ?? FILE;4445/** Where each page's screenshot goes: `e2e/out/<shot>.png`. */46const out = decodeURIComponent(new URL("out/", import.meta.url).pathname);4748/** What every page that could not reach the platform says instead of its content. */
1 unmodified line
5051/** What a code page said before its view was built; a deployed page never says it. */52const NOT_BUILT = "not built";5346/** A file every seeded datekit has, and the line its page is opened at. */47const FILE = "src/add.ts";4854/** `url` on the web. */55const at = (path: string) =>56 `${Option.getOrElse(settings.web, () => "")}${path}`;57
126 unmodified lines
184 test(`${project}'s code at main lists its folders and README`, ({185 page: browser,186 }) =>187 Effect.runPromise(183 code(browser, `/${project}/tree/main`, "code-tree", ["src", "README.md"])188 code(browser, `/${project}/tree/main`, "code-tree", [FOLDER, "README.md"])189 ));190191 test(`${project}'s ${FILE} opens at line 3`, ({ page: browser }) =>192 Effect.runPromise(
42 unmodified lines