Skip to content

Select a package's tests when its testdata/ changes #83

Closed

Description

@adityankale190895

Part of #76.

Any change under a testdata/ directory falls back today:

Changes in Go discovery-excluded paths require full validation, including runtime test data

By Go convention, pkg/testdata/** is read by the tests in pkg (the go tool sets the test's working directory to the package directory). So a change to internal/parser/testdata/case1.json usually needs only go test ./internal/parser.

Scope

  • In src/repo/impact.ts (where isGoDiscoveryIgnoredPath triggers the fallback), map a changed path under <dir>/testdata/ to the Go package whose directory is <dir>, and select that package's tests with a clear reason.
  • _-prefixed and .-prefixed directories keep falling back. Only testdata gets the convention.

Must fall back (blocker)

  • No package owns the parent directory.
  • Another package's test files mention that testdata path by literal string (for example "../parser/testdata"). Search the repository's _test.go files for the relative path.

Done when

  • A fixture shows that pkg/testdata/x.json selects ./pkg, and that a sibling test reading ../pkg/testdata makes it fall back.
  • The workaround through inputs declarations stays working.
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

    adapterenhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions