Skip to content

Script gates crash with ENOENT when a tracked file is not on disk #853

Description

@JArmandoAnaya

tests/scripts/design_tokens.test.mjs and its neighbours enumerate sources with git ls-files and then readFileSync each path with no guard. git ls-files reads the index, so a rename that is on disk but not staged leaves a tracked path with no file behind it, and the gate dies:

Error: ENOENT: no such file or directory, open '.../frontend/ui-core/src/screens/ingestScale.test.ts'
    at readFileSync (node:fs:439:20)
    at design_tokens.test.mjs:42:29

Three tests in that file fail at once, and the failure reads as a design-token violation rather than as a working-tree state. Reading the index deliberately is right - that is what catches a merely staged binary in the size guard - but a path it names may legitimately not be on disk yet.

Direction: skip (or report) a tracked path with no file, rather than throwing an error that names the wrong problem.

Activity

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

    ciCI, tooling, repo automationtoolingDeveloper tooling: scripts, checks, local workflow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions