Skip to content

[v1][breaking] Move test mocks out of public packages (loader, script) #88

@robbyt

Description

@robbyt

Summary

Two non-test files re-export testify/mock types in public packages, forcing every consumer of loader or script to pull testify into their dependency graph:

  • platform/script/loader/mock.goMockLoader, NewMockLoaderWithContent
  • platform/script/mocks.goMockCompiler, MockExecutableContent

A consumer importing only the production API gets testify and objx as transitive deps for free (see go.mod // indirect lines).

Proposal

Move these into *_test.go files in the same package (preferred — they look like internal testing aids that don't need to be public) or to a loadertest / scripttest subpackage that consumers can opt into.

Same review for engines/mocks/ (the evaluator.go / evaluatorResponse.go mocks) — confirm they're only used by tests, then move them.

Files

  • platform/script/loader/mock.go
  • platform/script/mocks.go
  • engines/mocks/
  • go.mod (testify should become a test dependency only — verify by go mod why github.com/stretchr/testify after)

This is a breaking-change candidate for v1; deletes exported types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions