Skip to content

Reject test registration from helper and non-suite modules #8358

Closed

Description

@jyaunches

Objective

Add an exception-free repository check that rejects accidental Vitest test registration from helper and other non-suite modules.

Prerequisite cleanup

Current accidental registrations must move before the guard lands:

Do not add a temporary or per-file allowlist.

Scope

  • Add a TypeScript-AST scan across repository JavaScript and TypeScript.
  • Resolve bindings imported from vitest.
  • Flag registration through describe, it, test, and suite, including modifier chains such as each, only, skip, skipIf, runIf, and concurrent.
  • Permit discoverable *.test.* and *.spec.* files and explicitly named *-suite.* shared registrars.
  • Do not flag Vitest imports alone or fixture extension such as base.extend(...).
  • Add scanner tests for registration, modifiers, aliases, comments and strings, fixtures, ordinary tests, and intentional suite files.
  • Wire the check into scripts/checks/run.mts beside existing test-boundary checks.

Intentional shared suites include test/local-credential-helper-suite.ts and test/openclaw-integrity-pin-suite.ts. Fixture modules such as test/helpers/owned-test-resources.ts and test/e2e/fixtures/*e2e-test.ts must remain valid.

Relationships

This is not a good first issue: it adds a repository-wide AST policy and must control false positives without an allowlist.

Acceptance criteria

  • The completed repository has zero violations.
  • Synthetic helper registrations and modifier chains fail.
  • Intentional suite modules, ordinary test files, and fixture extension pass.
  • Diagnostics include file, line, and remediation.
  • npm run checks:repository runs the check.

Validation

npx vitest run --project integration test/test-registration-boundary.test.ts
npm run checks:repository
npm run test:projects:check

Activity

  1. added
    area: ci
    area: architecture
    on Aug 5, 2026
  2. added theissue type on Aug 5, 2026
  3. self-assigned this
    on Aug 7, 2026
  4. added a commit that references this issue on Aug 7, 2026
    daab2e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: architecturearea: ci

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions