Skip to content

test: export EPP harness API and root discovery - #2611

Open
chethanuk wants to merge 4 commits into
llm-d:mainfrom
chethanuk:feat/1188-harness-api
Open

test: export EPP harness API and root discovery#2611
chethanuk wants to merge 4 commits into
llm-d:mainfrom
chethanuk:feat/1188-harness-api

Conversation

@chethanuk

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind cleanup
/kind test

What this PR does / why we need it:

Part of the #1188 split, following the ext_proc builders move. Nothing moves here.
The hermetic EPP harness gets the surface it will be moved with, and it stops
locating the repository by counting parent directories.

This branch is based on #2610, so the diff currently includes that PR's commit and
the two before it. Once those merge this becomes a single commit touching only
test/integration/epp.

test/integration/epp/harness.go gains Run(m *testing.M) int, which absorbs the
TestMain body from hermetic_test.go in its existing order, along with
repoRootPath and loadBaseResources so the harness travels complete. TestMain
becomes a one-line delegation. K8sClient, Config, Logger and Scheme wrap the
same package vars; GRPCConn and SetPodMetrics expose the harness fields the tests
already reach into; runMode, standaloneStrategy, testPoolName, cleanMetric,
metricReqTotal and metricReadyPods become their exported forms. Callers in the
package follow.

Root discovery does change behavior. TestMain took runtime.Caller(0) and joined
three .. onto the source file's directory for the repository root, then shelled
go list -m separately for the gateway-api-inference-extension CRD directory. A
moduleDir helper does both, resolving each module path through
go list -m -f {{.Dir}}. The old walk was source-tree relative and the replacement is
module relative; they agree with this repository as the main module and would differ
under a go.work replace.

That count of .. is why the two halves are separated. The harness lands in
test/framework/epp/harness, at a different depth, where a stale ../../.. still
compiles and resolves to a wrong directory that envtest reports as a missing CRD path.
Discovery is fixed ahead of the move so the move itself stays mechanical, under the
rule that no PR mixes a move with a behavior change.

Test plan:

  • go vet ./..., go vet -tags integration_tests ./test/... and gofmt -l .
    clean at this commit
  • go test ./test/framework/... and go test ./pkg/epp/server/... pass
  • go list -m -f {{.Dir}} resolves both the llm-d module root and
    sigs.k8s.io/gateway-api-inference-extension, and the llm-d root holds
    config/crd/bases

Which issue(s) this PR fixes:

Part of #1188

Release note (write NONE if no user-facing change):

NONE

The Pod builders in pkg/epp/util/testing are plain Kubernetes object helpers
with nothing EPP-specific about them, and they are used from outside the EPP
tree. Moving them to test/framework/k8s leaves wrappers.go holding only the
GAIE wrappers it is named for. The moved code is unchanged apart from the
package clause and a package comment, and keeps the copyright header it
carried; the corev1 import drops from wrappers.go because the remainder never
used it.

doc.go and .golangci.yml drop their test/framework/context references. That
package is out of scope for the issue, so the R1 rule and the importas alias
named a package that will not exist.

Part of llm-d#1188

Signed-off-by: ChethanUK <chethanuk@outlook.com>
This completes the wrappers.go removal llm-d#1188 asks for. The GAIE builders are
framework-generic: they touch the GAIE and apix API types and pkg/common/routing,
never pkg/epp, so they belong beside the other shared test builders rather than
under pkg/epp/util. With the last symbols gone, the package, its directory and
its importas alias go too, and no config references the dead path afterwards.

Part of llm-d#1188

Signed-off-by: ChethanUK <chethanuk@outlook.com>
test/integration held a 686-line grab bag of ext_proc request builders and
live executors that the integration suite imported as a package, which is the
cyclic-dependency risk llm-d#1188 calls out: helpers living inside the tree that
consumes them. The builders and executors are framework-generic, so they move
to test/framework/epp and test/integration stops being importable.

Five symbols are dropped rather than moved. ReqLLMWithStream, ReqLLMUnary and
StartExtProcServer have no callers, and GenerateRequestWithStream is reachable
only from ReqLLMWithStream, so moving them would ship zero-caller exports into
the new package. SendRequest had a single caller, in the test that moves with
it; that call site now uses the client Send and Recv pair SendRequest wrapped.

util_test.go moves with the code it covers, which is why the root package goes
away entirely rather than being left importable but empty. Its three tests
carry over, with assertions unchanged. The stub ext_proc server they shared
becomes an echo server that also backs new coverage for the moved builders and
client helpers.

The moved files keep the copyright header they carried.

Part of llm-d#1188

Signed-off-by: ChethanUK <chethanuk@outlook.com>
The next step moves this harness into test/framework, and a move is only
reviewable as a move if the surface it exposes is already settled. Export the
entrypoint and accessors here, in place, so the semantic changes land in a diff
the hermetic suite can be read against without a package move on top of them.

Root discovery stops counting parent directories and asks the module system
instead, because the count is exactly what a move would silently invalidate.

Part of llm-d#1188

Signed-off-by: ChethanUK <chethanuk@outlook.com>
@chethanuk
chethanuk requested a review from a team as a code owner August 28, 2026 19:41
@chethanuk
chethanuk requested review from ahg-g and elevran August 28, 2026 19:41
@github-actions github-actions Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/dev Related to dev tooling, experience, etc. area/epp area/scheduling area/datalayer labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/datalayer area/dev Related to dev tooling, experience, etc. area/epp area/scheduling size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant