-
Notifications
You must be signed in to change notification settings - Fork 287
Refactor Standalone EndpointPool initialization to ensure Test/Prod parity #2174
Copy link
Copy link
Closed
Labels
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
Metadata
Metadata
Assignees
Labels
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
What would you like to be added:
I propose refactoring the logic that constructs the
datalayer.EndpointPoolfor Standalone mode (currently residing incmd/epp/runner/runner.go) into a reusable library function.Current State:
runner.goparses CLI flags (--endpoint-selector,--endpoint-target-ports) and manually constructs theEndpointPoolstruct, performing logic like slice initialization and map conversion.test/integration/epp/harness.go(inWithStandaloneMode) manually reconstructs a similarEndpointPoolobject to inject into the Datastore, bypassing the CLI parsing logic entirely.Proposed Change:
Extract the construction logic into a shared function (e.g., in
pkg/epp/serverorpkg/epp/datalayer):Both
cmd/epp/runnerandtest/integration/eppshould use this shared function.Why is this needed:
This addresses a wiring gap between our production binary and our hermetic integration tests.
Recently, a regression (#2092) occurred in Standalone mode where the target ports slice was copied incorrectly in
runner.go, leading to a panic on startup. Even with the new integration tests for Standalone mode (#2175), this bug would not have been caught because the test harness re-implements the object construction logic instead of exercising the actual production code path.By sharing this initialization code, we ensure that logic errors in configuration parsing are caught immediately by the integration suite.
Additional Context:
While a smoke E2E test for standalone mode (to be tracked in a separate ticket) would also catch this class of bug by running the actual binary, maintaining unit/integration parity is valuable for faster feedback loops and cheaper debugging. Both approaches are independently valuable.