Refactor EPP initialization for unified integration testing#2351
Refactor EPP initialization for unified integration testing#2351k8s-ci-robot merged 7 commits intokubernetes-sigs:mainfrom
Conversation
…eModelRewrites is being watched.
|
@zetxqx: The label(s) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
b6d63bc to
68fce88
Compare
|
Note: the new commit introduces
Open to any comment for further refactoring. |
I'm not in favor of adding I propose to try an alternative approach: then tests can use test_runner.go. |
Great suggestion, I moved those custom method for integration test to separate |
would adding a NewTestRunner function help? |
Good call, updated. Refactored more, now we only need to set |
9682cce to
f4fd95c
Compare
…r.setup, remove serverRunner in testHarness and setUp return
| testEnv *envtest.Environment | ||
| testScheme = runtime.NewScheme() | ||
| logger = zap.New(zap.UseDevMode(true), zap.Level(zapcore.Level(logutil.DEFAULT))) | ||
| logger = zap.New(zap.UseDevMode(true), zap.Level(-1*zapcore.Level(logutil.DEFAULT))) |
| // 7. Register Cleanup | ||
| t.Cleanup(func() { | ||
| serverCancel() | ||
| // serverCancel() |
There was a problem hiding this comment.
how do we cancel the server now? don't we need to create a context with cancel, and pass the context to NewTestRunnerSetup above and call cancel here?
There was a problem hiding this comment.
Removed the comment. The server was ext_proc server started manually in the harness. Now since we are using setup we only needs to cancel the k8s manager, ext_proc is one of the runners managed by the manger.
|
/retest |
|
You didn't push a commit, also the failed test is a lint error: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_gateway-api-inference-extension/2351/pull-gateway-api-inference-extension-verify-main/2024575702841430016 |
1034b2f to
4a56d94
Compare
pass in the context
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, zetxqx The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
…es-sigs#2351) * add integration test for checking the inferenceObjective and inferenceModelRewrites is being watched. * continue refactor integration * not use opts.IsIntegrationTest. * inject PodMetricsClient via SetUp * remove unneeded function, rename skipNameValidation, unexported runner.setup, remove serverRunner in testHarness and setUp return * encapsulate more to harness * Update test/integration/epp/hermetic_test.go pass in the context --------- Co-authored-by: Abdullah Gharaibeh <[email protected]>
…es-sigs#2351) * add integration test for checking the inferenceObjective and inferenceModelRewrites is being watched. * continue refactor integration * not use opts.IsIntegrationTest. * inject PodMetricsClient via SetUp * remove unneeded function, rename skipNameValidation, unexported runner.setup, remove serverRunner in testHarness and setUp return * encapsulate more to harness * Update test/integration/epp/hermetic_test.go pass in the context --------- Co-authored-by: Abdullah Gharaibeh <[email protected]>
…es-sigs/gateway-api-inference-extension#2351) * add integration test for checking the inferenceObjective and inferenceModelRewrites is being watched. * continue refactor integration * not use opts.IsIntegrationTest. * inject PodMetricsClient via SetUp * remove unneeded function, rename skipNameValidation, unexported runner.setup, remove serverRunner in testHarness and setUp return * encapsulate more to harness * Update test/integration/epp/hermetic_test.go pass in the context --------- Co-authored-by: Abdullah Gharaibeh <[email protected]>
…es-sigs/gateway-api-inference-extension#2351) * add integration test for checking the inferenceObjective and inferenceModelRewrites is being watched. * continue refactor integration * not use opts.IsIntegrationTest. * inject PodMetricsClient via SetUp * remove unneeded function, rename skipNameValidation, unexported runner.setup, remove serverRunner in testHarness and setUp return * encapsulate more to harness * Update test/integration/epp/hermetic_test.go pass in the context --------- Co-authored-by: Abdullah Gharaibeh <[email protected]>
…es-sigs/gateway-api-inference-extension#2351) * add integration test for checking the inferenceObjective and inferenceModelRewrites is being watched. * continue refactor integration * not use opts.IsIntegrationTest. * inject PodMetricsClient via SetUp * remove unneeded function, rename skipNameValidation, unexported runner.setup, remove serverRunner in testHarness and setUp return * encapsulate more to harness * Update test/integration/epp/hermetic_test.go pass in the context --------- Co-authored-by: Abdullah Gharaibeh <[email protected]>

What type of PR is this?
/kind test
What this PR does / why we need it:
cmd/epp/runner):Setup()fromRun(). This method initializes the Manager, Datastore, and ExtProcServerRunner but yields them before starting, allowing tests to inspect state or inject dependencies.IsIntegrationTestto Options. When enabled,* this injects a
FakePodMetricsClient* bypasses k8s controller name validation.
test/integration):Which issue(s) this PR fixes:
Fixes partially #2332 , further refactor is needed, current implementation still rely on a
IsIntegrationTestflag in opts.This flag is now used in limited two places:
skipNameValidationto true.Fixes #2367
Does this PR introduce a user-facing change?: