Skip to content

cmd/go: make test caching aware of testdata directories #22583

Closed
@crawshaw

Description

@crawshaw

I have a test that processes test files from a testdata directory (that it finds using a filepath.Glob). Adding a new file to the directory and running "go test mypkg" ignores the new file, and returns the cached test results.

The go tool already has special handling for testdata directories: they are ignored when "go test" searches for packages to run. Could we extend this and include a hash of the contents of the testdatadirectory in the test cache key?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions