Skip to content
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

Improve eventing v1beta1 conversion tests #3395

Conversation

aliok
Copy link
Member

@aliok aliok commented Jun 24, 2020

Proposed Changes

I can improve conversion tests for other types after seeing how this PR goes.

UPDATE: I now realize in other conversion tests there was a test like v1->v1beta1->v1. (nothing on the current state of the source tree, but saw some stuff from Git history)
I will do that in a separate PR. let's merge this one anyway

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 24, 2020
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 24, 2020
@aliok aliok mentioned this pull request Jun 24, 2020
@@ -29,8 +29,10 @@ func (source *Broker) ConvertTo(ctx context.Context, to apis.Convertible) error
switch sink := to.(type) {
case *v1.Broker:
sink.Spec.Config = source.Spec.Config
if err := source.Spec.Delivery.ConvertTo(ctx, sink.Spec.Delivery); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

was getting a segfault here, discovered that with a new test case

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/eventing/v1beta1/broker_conversion.go 25.0% 77.8% 52.8
pkg/apis/eventing/v1beta1/trigger_conversion.go 18.2% 72.7% 54.5

@lberk
Copy link
Member

lberk commented Jun 24, 2020

/assign

@lberk
Copy link
Member

lberk commented Jun 24, 2020

/lgtm
Thanks @aliok! lgtm, but will leave the /approve to somebody else to make sure we get a second set of eyes on the PR

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2020
@aliok
Copy link
Member Author

aliok commented Jun 24, 2020

Oh, I now realize in other conversion tests (nothing on the current state of the source tree, but saw some stuff from Git history) there was a test like v1->v1beta1->v1.

I will do that in a separate PR. let's merge this one anyway if that's ok

@@ -45,16 +45,16 @@ func (source *Trigger) ConvertTo(ctx context.Context, to apis.Convertible) error
}

// ConvertFrom implements apis.Convertible
func (sink *Trigger) ConvertFrom(ctx context.Context, from apis.Convertible) error {
func (sink *Trigger) ConvertFrom(_ context.Context, from apis.Convertible) error {
Copy link
Member

Choose a reason for hiding this comment

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

why that ?

Copy link
Member Author

Choose a reason for hiding this comment

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

IDE was complaining unused var and I listen to my IDE

@vaikas
Copy link
Contributor

vaikas commented Jun 24, 2020

/lgtm
/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aliok, vaikas

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2020
@knative-prow-robot knative-prow-robot merged commit cd1d960 into knative:master Jun 24, 2020
lberk pushed a commit to lberk/eventing that referenced this pull request Jun 26, 2020
@lberk lberk mentioned this pull request Sep 1, 2020
@aliok aliok deleted the improve_eventing_v1beta1_conversion_tests branch April 28, 2021 06:57
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants