Skip to content

tests/test_design_reference.py hardcodes a contributor's local absolute path #29

Description

@davekopecek

Problem

tests/test_design_reference.py reads its CSS reference fixture from a hardcoded absolute path that only exists on the machine of whoever committed it:

REFERENCE = Path(
    "/private/tmp/claude-501/-Users-jonathanedwards-WORKSPACE-20-CLIENTS-NATE-10-ACTIVE-SYSTEMS-ringer-system/"
    "d4e72b45-c6bd-4928-aaf0-4e3552eb8f04/scratchpad/design-bake/design-reference.html"
)

test_renderer_tokens_match_design_reference fails with FileNotFoundError on any machine other than the original committer's. Confirmed on a clean clone of main (71763e6), Python 3.12.3, Linux.

This is two problems, not one: the path is unusable outside the original author's machine, and it leaks that author's local directory structure — OS username and what looks like a client/project name (CLIENTS-NATE-10-ACTIVE-SYSTEMS) — into a public repo. Referenced in passing in #28's PR description ("a missing machine-specific design-reference file") but never tracked as its own issue.

Suggested fix

Commit the reference fixture into the repo (e.g. tests/fixtures/design-reference.html) and point REFERENCE at a path relative to the test file, so the assertion is portable and the fixture ships with the source it's checked against.

Note: the original design-reference.html was never committed, so it can't be recovered — a fixture reconstructed from the current ARTIFACT_BASE_CSS values would restore the test's ability to catch future drift, but can't confirm whether ARTIFACT_BASE_CSS already silently drifted from what the original design-bake session approved (the test has been erroring, not failing, so it may never have actually caught a mismatch). If anyone still has the original file, it's worth checking against before trusting a reconstructed one.

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