Skip to content

CrossNamespace: e2e test to verify event delivery for broker and trigger#7933

Merged
knative-prow[bot] merged 66 commits into
knative:mainfrom
yijie-04:e2e_test
Jul 9, 2024
Merged

CrossNamespace: e2e test to verify event delivery for broker and trigger#7933
knative-prow[bot] merged 66 commits into
knative:mainfrom
yijie-04:e2e_test

Conversation

@yijie-04
Copy link
Copy Markdown
Contributor

@yijie-04 yijie-04 commented May 22, 2024

Fixes #7927

Proposed Changes

We should have an e2e test to verify that event delivery for broker and trigger when they are in different namespaces.

  • 🎁 Add new feature

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

Release Note


Docs

@knative-prow knative-prow Bot added area/test-and-release Test infrastructure, tests or release size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 22, 2024
@knative-prow knative-prow Bot requested review from mgencur and odacremolbap May 22, 2024 16:09
@yijie-04
Copy link
Copy Markdown
Contributor Author

/cc @Cali0707 @pierDipi

@knative-prow knative-prow Bot requested review from Cali0707 and pierDipi May 22, 2024 16:10
@yijie-04 yijie-04 changed the title CrossNamespace: e2e test to verify event delivery for broker and trigger [WIP] CrossNamespace: e2e test to verify event delivery for broker and trigger May 22, 2024
@knative-prow knative-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 22, 2024
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.

A different test structure could be to create 2 environments so that you don't need to create your namespaces

	brokerEnvCtx, brokerEnv := global.Environment(
		knative.WithKnativeNamespace(system.Namespace()),
		knative.WithLoggingConfig,
		knative.WithTracingConfig,
		k8s.WithEventListener,
		environment.Managed(t),
	)

	triggerEnvCtx, triggerEnv := global.Environment(
		knative.WithKnativeNamespace(system.Namespace()),
		knative.WithLoggingConfig,
		knative.WithTracingConfig,
		k8s.WithEventListener,
		environment.Managed(t),
	)

        brokerEnv.Test(brokerEnvCtx, t, broker.GoesReady(...))
        triggerEnv.Test(triggerEnvCtx, t, trigger.CrossNamespaceEventLink(brokerEnvCtx, ...))

@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2024

Codecov Report

Attention: Patch coverage is 22.22222% with 35 lines in your changes missing coverage. Please review.

Project coverage is 67.80%. Comparing base (9eed163) to head (e440cb1).
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/broker/filter/filter_handler.go 8.82% 30 Missing and 1 partial ⚠️
pkg/reconciler/broker/trigger/controller.go 50.00% 1 Missing and 2 partials ⚠️
pkg/reconciler/sugar/trigger/controller.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7933      +/-   ##
==========================================
- Coverage   67.85%   67.80%   -0.05%     
==========================================
  Files         367      367              
  Lines       17356    17377      +21     
==========================================
+ Hits        11777    11783       +6     
- Misses       4844     4859      +15     
  Partials      735      735              

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

@pierDipi
Copy link
Copy Markdown
Member

/test reconciler-tests

Comment thread test/rekt/crossnamespace_test.go Outdated
Comment thread test/rekt/crossnamespace_test.go Outdated
Comment thread test/rekt/crossnamespace_test.go Outdated
Comment thread test/rekt/crossnamespace_test.go Outdated
Comment thread test/rekt/crossnamespace_test.go Outdated
Comment thread test/rekt/features/trigger/crossnamespace.go Outdated
Comment thread test/rekt/features/trigger/crossnamespace.go Outdated
@Cali0707
Copy link
Copy Markdown
Member

Cali0707 commented Jul 5, 2024

/test reconciler-tests

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 5, 2024
@Cali0707
Copy link
Copy Markdown
Member

Cali0707 commented Jul 5, 2024

@yijie-04 can you rebase this PR?

@knative-prow knative-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2024
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 5, 2024
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

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

knative-prow Bot commented Jul 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, yijie-04

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

@yijie-04
Copy link
Copy Markdown
Contributor Author

yijie-04 commented Jul 5, 2024

/test reconciler-tests

Signed-off-by: Calum Murray <cmurray@redhat.com>
@knative-prow knative-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2024
@Cali0707
Copy link
Copy Markdown
Member

Cali0707 commented Jul 5, 2024

/cc @Leo6Leo

Can you TAL? I've added a decent amount of my code to this PR so it would be good to get the final LGTM from someone else

@yijie-04
Copy link
Copy Markdown
Contributor Author

yijie-04 commented Jul 5, 2024

@Cali0707 I think there are also some tab/space issues for the license

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.

These should fix the license issues

Comment thread test/rekt/crossnamespace_test.go Outdated
Comment thread test/rekt/features/broker/crossnamespace.go Outdated
Comment thread test/rekt/features/trigger/crossnamespace.go Outdated
@knative-prow knative-prow Bot requested a review from Leo6Leo July 5, 2024 17:45
yijie-04 and others added 3 commits July 5, 2024 14:18
Co-authored-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Calum Murray <cmurray@redhat.com>
Copy link
Copy Markdown
Member

@Leo6Leo Leo6Leo left a comment

Choose a reason for hiding this comment

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

Only one nit, otherwise, it looks great to me!

Comment thread test/rekt/resources/trigger/trigger.go Outdated
@Cali0707
Copy link
Copy Markdown
Member

Cali0707 commented Jul 9, 2024

/retest

@yijie-04
Copy link
Copy Markdown
Contributor Author

yijie-04 commented Jul 9, 2024

/test reconciler-tests

@yijie-04
Copy link
Copy Markdown
Contributor Author

yijie-04 commented Jul 9, 2024

/retest

@Leo6Leo
Copy link
Copy Markdown
Member

Leo6Leo commented Jul 9, 2024

/lgtm

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2024
@knative-prow knative-prow Bot merged commit 8e7c775 into knative:main Jul 9, 2024
@yijie-04 yijie-04 deleted the e2e_test branch July 9, 2024 18:41
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CrossNamespace: Testing Data Plane Changes for Broker Filter

5 participants