Skip to content
Myr

Keep W10 group A's merged gate green under a full test run

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

- The project page's two server-render tests seed a fresh dev world, as client.test.ts and dev-backend.test.ts do; they now carry the same 30 s seededWorld timeout. Under verify's parallel run the README case took 7.1 s (619 ms alone) and timed out at 5 s. - Whole-repo scans in @repo/config read every file one at a time (an exists and a read each, ~1,000 files), so the cartridge reachability test took 5.2 s under load (350 ms alone) and failed, as 1003's review saw once. root.ts' readsAtOnce reads 32 at once in the cartridge test and docs-public's plan-citation scan; the cartridge case now takes 2.5 s under the same load. - No check loosened: no assertion changed, and the timeout matches the one the repo already gives every seeded dev world.

authored by oscabriel · committed by oscabriel · parent 7de721c · Browse files · 4 files+36 added−18 removed
This commit

State

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

Diff stats

4 files+36 added−18 removed

  • tests:+36 added−18 removed

4 files+36 added−18 removed

modified:apps/web/test/project.test.tsx+7 added-2 removed
347 unmodified lines
348);349350const decodePage = Schema.decodeEffect(ProjectPageData);351352/** A fresh dev world seeds itself first, which a full test run can slow past 5 s. */353const seededWorld = { timeout: 30_000 };354355describe("the project's page as the server sends it", () => {356 it.effect(357 "carries datekit's README and its root entries, read on the server",358 () =>
14 unmodified lines
373 expect(textOf(sent)).toContain("Small, dependency-free date helpers");374 expect(markupOf(sent)).toContain('data-readme="README.md"');375 expect(markupOf(sent)).toContain('href="/datekit/tree/main/src"');376 expect(textOf(sent)).toContain(`git clone ${platformUrl}/datekit.git`);374 })377 }),378 seededWorld379 );380381 it.effect(382 "shows a project whose main has not landed with no code, and no error",
54 unmodified lines
437 readProjectPage(name).pipe(Effect.provide(devWorld))438 );439440 expect(isNotFound(failed)).toBeTruthy();437 })441 }),442 seededWorld443 );444});445446describe(UnknownProjectView, () => {
89 unmodified lines
modified:packages/config/test/cartridge.test.ts+8 added-5 removed
17 unmodified lines
18import { describe, expect, it } from "@effect/vitest";19import { Array, Effect, FileSystem, Option, Path, Schema } from "effect";20import type { ChildProcessSpawner } from "effect/process";2122import { committable, repoRoot, textOf } from "./root.ts";22import { committable, readsAtOnce, repoRoot, textOf } from "./root.ts";2324/** The cartridge's folders, from the repo root; each ends with `/`, and each exists. */25const MANIFEST = [26 "packages/visibility/",
100 unmodified lines
127128/** Every committable file with its text, `filter` deciding which. */129const filesWhere = (filter: (file: string) => boolean) =>130 Effect.flatMap(committable, (files) =>131 Effect.forEach(132 files.filter(filter),131 Effect.forEach(files.filter(filter), (file) =>132 Effect.map(textOf(file), (text) =>133 Option.map(text, (content) => ({ content, file }))134 )133 (file) =>134 Effect.map(textOf(file), (text) =>135 Option.map(text, (content) => ({ content, file }))136 ),137 readsAtOnce138 )139 ).pipe(Effect.map(Array.getSomes));140141// --------------------------------------------------------- reading code
608 unmodified lines
modified:packages/config/test/docs-public.test.ts+14 added-11 removed
8 unmodified lines
9import { NodeServices } from "@effect/platform-node";10import { describe, expect, it } from "@effect/vitest";11import { Array, Effect, FileSystem, Option, Order, Path, Schema } from "effect";1213import { committable, repoRoot, textOf } from "./root.ts";13import { committable, readsAtOnce, repoRoot, textOf } from "./root.ts";1415/**16 * What a pointer to something only the maintainer can open looks like: a17 * home folder, the private research repo or the host that serves it, or the
140 unmodified lines
158 const files = (yield* committable).filter(159 (file) => TEXT_FILE.test(file) && file !== QUOTES_THE_REFERENCES160 );161162 const found = yield* Effect.forEach(163 files,162 const found = yield* Effect.forEach(files, (file) =>163 Effect.map(textOf(file), (text) =>164 Option.match(text, {165 onNone: () => [],166 onSome: (content) =>167 planReferencesIn(content).map(168 (pattern) => `${file}: ${pattern}`169 ),170 })171 )164 (file) =>165 Effect.map(textOf(file), (text) =>166 Option.match(text, {167 onNone: () => [],168 onSome: (content) =>169 planReferencesIn(content).map(170 (pattern) => `${file}: ${pattern}`171 ),172 })173 ),174 readsAtOnce175 );176177 expect(found.flat()).toStrictEqual([]);178 }).pipe(Effect.provide(NodeServices.layer))
72 unmodified lines
modified:packages/config/test/root.ts+7 added