Skip to content

Event type test logical error#7166

Merged
knative-prow[bot] merged 21 commits into
knative:mainfrom
Leo6Leo:eventType-test-logical-error
Oct 2, 2023
Merged

Event type test logical error#7166
knative-prow[bot] merged 21 commits into
knative:mainfrom
Leo6Leo:eventType-test-logical-error

Conversation

@Leo6Leo
Copy link
Copy Markdown
Member

@Leo6Leo Leo6Leo commented Aug 10, 2023

Fixes #7158

Proposed Changes

Rework with the logic to be

for each event type in the list:
  - remove it from expectedCeTypes (ideally after cloning the object to not change the caller object)

assert that expectedCeTypes is empty

And also add the support to enable the auto eventType creation. Currently PingSource doesn't support the auto eventType Creation. We are enable the broker side auto eventType creation for now. Otherwise, the test will be failing.

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Signed-off-by: Leo Li <leoli@redhat.com>
Signed-off-by: Leo Li <leoli@redhat.com>
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Aug 10, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 10, 2023
@knative-prow knative-prow Bot added the area/test-and-release Test infrastructure, tests or release label Aug 10, 2023
Signed-off-by: Leo Li <leoli@redhat.com>
Signed-off-by: Leo Li <leoli@redhat.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 10, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (25400fb) 77.73% compared to head (ecb2265) 77.73%.
Report is 40 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7166   +/-   ##
=======================================
  Coverage   77.73%   77.73%           
=======================================
  Files         246      246           
  Lines       13284    13284           
=======================================
  Hits        10326    10326           
  Misses       2435     2435           
  Partials      523      523           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Leo Li <leoli@redhat.com>
@Leo6Leo Leo6Leo marked this pull request as ready for review August 10, 2023 18:53
@knative-prow knative-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2023
@Leo6Leo
Copy link
Copy Markdown
Member Author

Leo6Leo commented Aug 10, 2023

/cc @creydr @matzew @Cali0707
Ready for review

@knative-prow knative-prow Bot requested review from Cali0707, creydr and matzew August 10, 2023 19:12
Comment thread test/rekt/resources/eventtype/eventtype.go Outdated
Comment on lines +141 to +143
// Enable the eventtype auto-creation in configmap
f.Setup("enable eventtype auto-creation", eventtype.ApplyEventTypeConfigMap())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should be enabling experimental features in the rekt (non-experimental) tests. Maybe if the events are not created by the ping source it makes more sense to remove the assertion rather than enabling this?

Comment thread test/rekt/resources/eventtype/eventtype.go
Co-authored-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Leo Li <leoli@redhat.com>
@Leo6Leo
Copy link
Copy Markdown
Member Author

Leo6Leo commented Aug 14, 2023

#7165 (comment)

As Knative documentation said, Support for automatic registration is not supported for PingSource.
Should we add the support for PingSource to have auto eventType creation? Or we will enable the broker-side eventType auto creation for PingSource's rekt test?

So for this ticket, any suggestions on what should we do next? Should we add the support for PingSource to have auto eventType creation? @creydr

@Leo6Leo Leo6Leo force-pushed the eventType-test-logical-error branch from ce97b63 to 5783715 Compare August 14, 2023 15:08
@creydr
Copy link
Copy Markdown
Member

creydr commented Aug 15, 2023

#7165 (comment)

As Knative documentation said, Support for automatic registration is not supported for PingSource.
Should we add the support for PingSource to have auto eventType creation? Or we will enable the broker-side eventType auto creation for PingSource's rekt test?

So for this ticket, any suggestions on what should we do next? Should we add the support for PingSource to have auto eventType creation? @creydr

I agree with @Cali0707 in https://github.com/knative/eventing/pull/7166/files#r1290583414. We should not enable experimental features at this place.
For this PR to fix this logic (as the current logic is wrong), I would move this test to the experimental tests and then (when we have the support for auto event type creation in the pingsource) move it to the regular suite back (IMO).
That way, we can reuse the eventtype.WaitForEventType() and eventtype.AssertPresent() in other tests with the correct logic.

Signed-off-by: Leo Li <leoli@redhat.com>
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 25, 2023
@knative-prow knative-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 25, 2023
@Leo6Leo
Copy link
Copy Markdown
Member Author

Leo6Leo commented Aug 25, 2023

/cc @Cali0707

@Leo6Leo
Copy link
Copy Markdown
Member Author

Leo6Leo commented Aug 28, 2023

/unhold Ready for review

Comment thread test/rekt/apiserversource_test.go Outdated
Comment thread test/rekt/features/pingsource/features.go
Comment thread test/rekt/pingsource_test.go Outdated
…metal dir

Signed-off-by: Leo Li <leoli@redhat.com>
@knative-prow knative-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 28, 2023
@Leo6Leo
Copy link
Copy Markdown
Member Author

Leo6Leo commented Aug 28, 2023

/hold clean everything up

Signed-off-by: Leo Li <leoli@redhat.com>
@knative-prow knative-prow Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 28, 2023
@Leo6Leo Leo6Leo requested a review from matzew September 5, 2023 18:55
@Leo6Leo
Copy link
Copy Markdown
Member Author

Leo6Leo commented Sep 5, 2023

/unhold

@knative-prow knative-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 5, 2023
Copy link
Copy Markdown
Member

@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks @Leo6Leo!

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2023
@Cali0707
Copy link
Copy Markdown
Member

Cali0707 commented Sep 5, 2023

@Leo6Leo I just realized the reconciler tests are still failing for this PR. Could you try and fix those?

Copy link
Copy Markdown
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented Oct 2, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, Leo6Leo, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 2, 2023
@Leo6Leo
Copy link
Copy Markdown
Member Author

Leo6Leo commented Oct 2, 2023

/retest-required

@knative-prow knative-prow Bot merged commit 69dbad2 into knative:main Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventType Test Logical Error

6 participants