Skip to content

docs-build and ralph-triage tests break on team rebirths and blog changes #282

Closed

Description

@tamirdresher

Problem

Several tests read live .squad/ and docs/blog/ files but hardcode specific content in assertions. This means routine team operations (rebirths, adding/removing members, blog posts) break CI.

Affected tests

ralph-triage.test.ts — reads live .squad/team.md\ and .squad/routing.md, then asserts specific agent names:

  • \�xpect(roster.find(m => m.name === 'Hockney'))\ — breaks on any rename
  • \�xpect(rules.find(r => r.workType === 'Core runtime')?.agentName).toBe('Fenster')\ — same

docs-build.test.ts — hardcodes an \EXPECTED_BLOG\ array with every blog post slug:

speed-gates.test.ts — hardcodes help output line count:

  • Adding any new CLI command to help text can exceed the budget

Root cause

Tests that validate parsing logic (does parseRoster work?) are coupled to live mutable content (what's the current roster?). These are two separate concerns that should be tested independently.

Proposed fix

  1. ralph-triage.test.ts: Live-file tests should assert structure/behavior (non-empty results, correct property shapes, emoji presence), not specific names. Name-specific tests should use inline fixtures.

  2. docs-build.test.ts: Instead of hardcoding \EXPECTED_BLOG = ['026-...', '025-...', ...], dynamically discover blog posts from the filesystem:
    eaddirSync('docs/blog').filter(f => f.endsWith('.md')).

  3. speed-gates.test.ts: Use a generous budget or make it relative to the number of registered commands.

Impact

PR #280 includes the ralph-triage + speed-gates fix. The docs-build fix (dynamic discovery) is a separate change worth doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions