-
Notifications
You must be signed in to change notification settings - Fork 574
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
Dataplane conformance tests #6811
Dataplane conformance tests #6811
Conversation
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Hi @vishal-chdhry. Thanks for your PR. I'm waiting for a knative 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/test-infra repository. |
eventing/test/rekt/features/broker/data_plane.go Lines 60 to 63 in 1ff36e1
and eventing/test/rekt/features/broker/data_plane.go Lines 112 to 113 in 1ff36e1
the same? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6811 +/- ##
=======================================
Coverage 79.96% 79.96%
=======================================
Files 237 237
Lines 12354 12354
=======================================
Hits 9879 9879
Misses 1981 1981
Partials 494 494 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Hi @pierDipi, can you please explain these to me? What does eventing/test/rekt/features/broker/data_plane.go Lines 134 to 141 in 1ff36e1
And for the observability tests eventing/test/rekt/features/broker/data_plane.go Lines 154 to 169 in 1ff36e1
|
Yes, correct |
This is explained shortly here: https://knative.dev/docs/eventing/ with:
For the Trigger's subscriber the "reply event" is the HTTP response that contains a new event and it is sent back by the Trigger to the associated Broker. Now, provided what is the reply event
These 3 tests need to test all the cases, in particular:
this is the case where the reply event is malformed/not an actual cloudevent, in that case, we expect that the original event (the one in request, so not the reply event) will be resent to the Trigger's subscriber ( see comment on case 3).
I would leave this as todo for now, since we don't have defined a way of doing this.
This is basically case 1 + making sure that the delivery is retried when 1 happens, so we can have a single test for 3 and test case 1 as well (therefore we can remove case 1) |
Thanks for doing this! Let me know if you need further information! |
For observability tests I would recommend doing a separate PR and connect with @mgencur (on Slack or on the original GitHub issue) since Martin worked on some of those implementation specific tests in the past.
We can only tests tracing related ones, in particular, we need to verify that:
For this case, we need to verify that the Trigger's subscriber receives a
This should verify that the tracing backend contains the additional tracing spans in addition to the source and the subscriber ones
This should verify that there is at least one tracing span in the tracing span tree that contains the tags matching the Semantic Conventions for Messaging Systems |
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
/ok-to-test |
/assign @creydr |
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.
Hello @vishal-chdhry,
Thanks a lot for working on this 👍 . This is really great to have some more conformance tests implemented.
I left a few comments on it so far. I hope they help
eventshub.InputEvent(event), | ||
) | ||
|
||
assert.OnStore(sink).MatchEvent(test.HasId(event.ID()), test.HasSpecVersion(version)).Exact(1) |
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.
This returns a StepFn
only. Maybe you could check on AcceptsCEVersions
how it is done there.
As deliveredCESpecs
itself is a StepFn, maybe you could do something like this too:
assert.OnStore(sink).MatchEvent(test.HasId(event.ID()), test.HasSpecVersion(version)).Exact(1) | |
assert.OnStore(sink).MatchEvent(test.HasId(event.ID()), test.HasSpecVersion(version)).Exact(1)(ctx, 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.
is it better to do
assert.OnStore(sink).MatchEvent(test.HasId(event.ID()), test.HasSpecVersion(version)).Exact(1)(ctx, t)
or
store := eventshub.StoreFromContext(ctx, source)
events := knconf.Correlate(store.AssertAtLeast(t, 2, knconf.SentEventMatcher("")))
for _, e := range events {
if e.Response.StatusCode < 200 || e.Response.StatusCode > 299 {
t.Errorf("Expected statuscode 2XX for sequence %d got %d", e.Response.Sequence, e.Response.StatusCode)
}
}
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.
@creydr For now, I have done what was suggested in this comment at every place because I observed that we are using event assert in recent commits and eventshub.StoreFromContext
in older ones.
I can definitely use the latter if i should
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
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.
Hello @vishal-chdhry,
thanks for the update. Can you check, why the reconciler-tests are failing (maybe only a rebase needed), so we can check if these tests pass?
// Since there are no triggers, there should be no events | ||
assert.OnStore(sink).Exact(0)(ctx, t) | ||
|
||
// TODO: Check if source is notified or not |
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.
Should("Events contained in delivery responses SHOULD be published to the Broker ingress and processed as if the event had been produced to the Broker's addressable endpoint.", | ||
todo). | ||
Should("Events contained in delivery responses that are malformed SHOULD be treated as if the event delivery had failed.", |
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.
Why is this test removed?
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.
We can add that case to If the reply event was not accepted, the initial event SHOULD be redelivered to the subscriber.
Here is a great explainer from PierDipi #6811 (comment)
|
||
// Since the reply event was invalid, there should be atleast 2 events | ||
eventasssert.OnStore(sink1).Match(eventMatcher).AtLeast(2)(ctx, t) | ||
eventasssert.OnStore(sink2).Match(eventMatcher).Not()(ctx, 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.
Since trigger2 does not have any filters, wouldn't sink2 receive the original event too?
Cron -knative-prow-robot /cc knative/eventing-writers /assign knative/eventing-writers Produced by: knative-sandbox/knobots/actions/update-deps Signed-off-by: Knative Automation <automation@knative.team>
This patch adds support for the `K_CA_CERTS` environment variable for the source adapter library. This will enable the APIServerSource data plane and other sources leveraging adapter/v2 to work with the Eventing TLS feature. Fixes: knative#6847 --------- Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Vishal-Chdhry The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test reconciler-tests |
@vishal-chdhry: The following test failed, say
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. I understand the commands that are listed here. |
@creydr In some places, it is failing because of the error, pod is not running
I need to check |
That's a good question, as we have a bit different setup for the conformance tests 🤔 |
hmm, no, there isn't, I was thinking to new rekt APIs for basically branching a feature to a "sub-feature" but I'm not too convinced, the other approach is to have separate tests instead of being "assertions / steps" |
Hey @vishal-chdhry, |
I will just convert all these tests to being seperate tests, that seems like the more straight forward approach |
This Pull Request is stale because it has been open for 90 days with |
/remove-lifecycle stale |
Oh I totally forgot about this 😅 I will try to fix this, thanks for the ping @creydr! |
This Pull Request is stale because it has been open for 90 days with |
@vishal-chdhry do let me know if your continuing this or else I'm happy to continue from here |
This Pull Request is stale because it has been open for 90 days with |
Part of #6796
Part of #5782
Proposed Changes
Pre-review Checklist
Release Note
Docs