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.
@lionelvillard the spec.subscribers are only populated by the Subscription, right ?
|
/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. 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/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? |
antoineco
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
import "knative.dev/eventing/pkg/apis/messaging"
// ...
gvr := messaging.ChannelsResource.String()There was a problem hiding this comment.
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
| // 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.
The error doesn't need quotes I believe. (comment applies to other occurrences as well)
There was a problem hiding this comment.
Converted all of them now to %s
| { | ||
| UID: "1234", | ||
| ReplyURI: sampleUrl, | ||
| }, |
There was a problem hiding this comment.
Is it even necessary to add an element to the array for this assertion?
There was a problem hiding this comment.
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 DetailsNeeds 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 supportChannelsee spec change here: https://github.com/knative/eventing/pull/3132/files