Skip to content

codegen: golden tests fail on Windows with autocrlf #339

Description

@dajiaohuang

Description

On a normal Windows checkout with core.autocrlf=true, the codegen golden tests compare LF generated output with CRLF checked-in fixtures and fail. The surface allowlist checks also fail because their end-of-line regex sees the carriage return. A fresh checkout with core.autocrlf=false passes the same tests. The repository advertises Windows development, so this makes a clean Windows checkout fail its local test suite.

Steps to reproduce

  1. Clone heygen-com/heygen-cli on Windows.
  2. Configure core.autocrlf=true and check out main.
  3. Run: go test ./codegen -run TestGoldenFiles|TestSurfaceAllowlistCoversEveryTemplateField|TestSurfaceAllowlistMatchesRealGeneratedLines -count=1

Output

The clean checkout reports 0 passed and 6 failed: TestGoldenFiles/{registry.go,upload.go,widget.go}, TestSurfaceAllowlistCoversEveryTemplateField, and TestSurfaceAllowlistMatchesRealGeneratedLines. With a one-line .gitattributes rule (* text=auto eol=lf), all six pass in a fresh clone.

CLI version

heygen version dev

OS

Windows 11, PowerShell, Go 1.23+

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions