Skip to content

Extract workers test helpers into internal/workertest#383

Open
lilydoar wants to merge 1 commit into
lilydoar/stack/14from
lilydoar/stack/15
Open

Extract workers test helpers into internal/workertest#383
lilydoar wants to merge 1 commit into
lilydoar/stack/14from
lilydoar/stack/15

Conversation

@lilydoar
Copy link
Copy Markdown
Contributor

@lilydoar lilydoar commented May 29, 2026

Stacked PRs:


Extract workers test helpers into internal/workertest

workers/test_env.go, test_workers.go, and test_historyrequire.go were
package workers (production) files: the test_ prefix is not special to Go
(only _test.go is excluded from builds), so this test-support code compiled
into the shipped binary and forced production-only edges from package workers
into loadgen/devserver/versions that only the test harness needs.

Move them to a dedicated internal/workertest package (env.go, workerpool.go,
historyrequire.go). The helpers reference a few production symbols (Builder,
Runner, BaseDir, and the previously-unexported logWriter), so export logWriter
as LogWriter with a NewLogWriter constructor and qualify the rest. Update the
consumers (loadgen and scenario tests) to import internal/workertest.

Testing: go build ./... and go vet ./... pass; the loadgen and scenario
test packages compile against the new import path.

@lilydoar lilydoar requested review from a team as code owners May 29, 2026 21:13
workers/test_env.go, test_workers.go, and test_historyrequire.go were
package workers (production) files: the test_ prefix is not special to Go
(only _test.go is excluded from builds), so this test-support code compiled
into the shipped binary and forced production-only edges from package workers
into loadgen/devserver/versions that only the test harness needs.

Move them to a dedicated internal/workertest package (env.go, workerpool.go,
historyrequire.go). The helpers reference a few production symbols (Builder,
Runner, BaseDir, and the previously-unexported logWriter), so export logWriter
as LogWriter with a NewLogWriter constructor and qualify the rest. Update the
consumers (loadgen and scenario tests) to import internal/workertest.

Testing: `go build ./...` and `go vet ./...` pass; the loadgen and scenario
test packages compile against the new import path.

stack-info: PR: #383, branch: lilydoar/stack/15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant