-
Notifications
You must be signed in to change notification settings - Fork 179
feat(conformance): Use CRD annotation to populate the ConformanceReport GatewayAPIInferenceExtensionVersion #1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hi @zetxqx. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @robscott |
/ok-to-test |
/approve This looks good to me. Will let one of the manual assignees give final stamp |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kfswain, zetxqx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks @zetxqx! /lgtm |
Thanks! @kfswain /hold Looks like the manifest in the latest release(https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases/tag/v0.5.1) does not have the annotation yet. This should be submitted after a new release. |
Sorry, what annotation is needed? We probably wont have a release for a bit, so trying to understand what's preventing this from merging |
@kfswain the change here reads the annotation from inferencePool's CRD to populate the ConformanceReport
|
Holding until v1.0 is cut, which will include the "inference.networking.k8s.io/bundle-version" CRD annotation. |
conformance/conformance.go
Outdated
require.NoError(t, err, "error initializing conformance suite") | ||
|
||
installedCRDs := &apiextensionsv1.CustomResourceDefinitionList{} | ||
err = opts.Client.List(context.TODO(), installedCRDs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the use of context in conformance is not aligned with best practices.
I was hoping to see context created one time in "main" (e.g., in the entry point), and then ctx is propagated in the function calls (usually as first arg).
I've never ran the conformance test suite myself, but if it's a long running process (more than few minutes), it may make sense to use context with signal handling (listening to SIGTERM, SIGKILL).
see example in our main file where we use SetupSignalHandler()
:
if err := runner.NewRunner().Run(ctrl.SetupSignalHandler()); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good call! I've replaced it by creating a context.Background()
at the start of the test run and propagating it down. The conformance tests is executed by go test
. Each test function serves as its own entry point. The overall process termination is managed by the go test --timeout
flag, so setting up a custom signal handler here isn't necessary as it would be in a long-running service.
Ref:
func TestConformance(t *testing.T) { |
go test
/lgtm |
/hold cancel |
…rt GatewayAPIInferenceExtensionVersion (#1214) * Use CRD annotation to get the inferencePool BundleVersion for ConformanceReport. * ctx best practices.
Currently, the conformance report is using hard-coded variable
BundleVersion
inversion.go
. This PR get the version from annotationBundleVersionAnnotation
of installed CRDs.Tested locally, the following is an example generated report, I installed v0.5.0 CRDs.
A follow up PR is to change
BundleVersion
fromv1.0.0-dev
tomain-dev
.