-
Notifications
You must be signed in to change notification settings - Fork 600
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
Channel conformance tests for spec.subscriber #3050
Channel conformance tests for spec.subscriber #3050
Conversation
Meta Following is a simplified example of the failure:
ends up in
Created #3051 |
} | ||
|
||
// SPEC: each channel CRD MUST contain an array of subscribers: spec.subscribers | ||
channelable.Spec.Subscribers = []eventingduckv1beta1.SubscriberSpec{ |
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.
@lionelvillard the spec.subscribers
are only populated by the Subscription, right ?
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.
Some new info: #3051 (comment)
/retest |
/retest |
123b020
to
ad7673e
Compare
once #3129 is merged, retest and I'm hoping this conformance test should pass (passed locally 🤞 ) |
/reopen |
@lberk: Reopened this PR. In 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/test-infra repository. |
/test pull-knative-eventing-integration-tests |
I chatted with @aliok this morning, and perhaps I need a bit more clarification as I look over this PR (and how it relates to #3051) Relevant part of the spec is:
Part of this conformance test sets these subscriber fields directly (which is landing in an error[1]). I think in order to correct this conformance test, we need to have the client create a subscription targeting the channel, and then verify that the channel then mirrors that subscription to the spec array. Not set the subscribers field directly. To me this means the spec is still valid (though perhaps could be tweaked to suggest the array of subscribers should not be set directly, but via subscriptions). Thoughts? Suggestions? @aliok @matzew @vaikas [1] - |
Yeah, I can change the test that way.
|
0041836
to
28b90a9
Compare
/assign @lberk want to review? |
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.
Nice tests! A few nits.
}) | ||
} | ||
|
||
func channelSpecAllowsSubscribersArray(st *testing.T, client *lib.Client, channel metav1.TypeMeta, options ...lib.SetupClientOption) { |
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'm curious about the reason behind this st
variable name when other tests seem to unanimously use t
.
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.
single or specific test perhaps? I've seen tt vs t used in other spots as well iirc, I'm not sure we need to bike shed the variable name too much?
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.
Like I said, just nits
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've seen that's setup that way in other conformance tests and used it that way.
But I think it could make sense.
st
is defined here in the test runner call: https://github.com/knative/eventing/pull/3050/files#diff-5d560f68ffc10b7bccae5ab980f0ffddR41
Let's ignore that here in this PR and if we would like to change that var name, let's do that in a separate PR for all other tests as well.
client.WaitForResourceReadyOrFail(channelName, &channel) | ||
|
||
sampleUrl, _ := apis.ParseURL("http://example.com") | ||
gvr, _ := meta.UnsafeGuessKindToResource(channel.GroupVersionKind()) |
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.
import "knative.dev/eventing/pkg/apis/messaging"
// ...
gvr := messaging.ChannelsResource.String()
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.
channel
here is actually passed by the test runner and it is different in each execution of the test.
- IMC v1alpha1
- IMC v1beta1
- Channel v1alpha1
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.
OK makes sense now
// treat missing annotation value as v1alpha1, as written in the spec | ||
channelable, err := getChannelAsV1Alpha1Channelable(channelName, client, channel) | ||
if err != nil { | ||
st.Fatalf("Unable to get channel %q to v1alpha1 duck type: %q", channel, err) |
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.
The error doesn't need quotes I believe. (comment applies to other occurrences as well)
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.
Converted all of them now to %s
{ | ||
UID: "1234", | ||
ReplyURI: sampleUrl, | ||
}, |
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.
Is it even necessary to add an element to the array for this assertion?
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 think it is actually better to have an element inside the array instead of setting an empty array
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aliok, matzew 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 |
Fixes #2988
Proposed Changes
spec.subscriber
(orspec.subscribable.subscriber on v1alpha1 channel duck type support
Channel
see spec change here: https://github.com/knative/eventing/pull/3132/files