Skip to content

Use the builder pattern to improve readability of configuration table testing#1924

Closed
dprotaso wants to merge 2 commits into
knative:masterfrom
dprotaso:configuration-fixture-builder
Closed

Use the builder pattern to improve readability of configuration table testing#1924
dprotaso wants to merge 2 commits into
knative:masterfrom
dprotaso:configuration-fixture-builder

Conversation

@dprotaso
Copy link
Copy Markdown
Member

From the PoC (#1762) this is the cleanup for the configuration table test

Will focus on revision & route next.

@knative-prow-robot knative-prow-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 22, 2018
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dprotaso
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: mattmoor

If they are not already assigned, you can assign the PR to them by writing /assign @mattmoor in a comment when ready.

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

@dprotaso
Copy link
Copy Markdown
Member Author

/assign @mattmoor @grantr @jonjohnsonjr

obj *v1alpha1.Configuration
}

func Config(name, namespace string) ConfigBuilder {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm going to swap this to be (namespace, name string) to be consistent with revision & route table tests

@dprotaso dprotaso force-pushed the configuration-fixture-builder branch from 5430735 to 8e280ed Compare August 22, 2018 18:32
@dprotaso
Copy link
Copy Markdown
Member Author

/hold

Going to experiment a bit further with some things

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 22, 2018

func (bldr ConfigBuilder) ToChildBuild(convert ConfigToBuildFunc) *buildv1alpha1.Build {
return convert(bldr.Build())
}
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.

Feels like this should maybe return a BuildBuilder, WDYT?

return RevisionBuilder{convert(bldr.Build())}
}

func (bldr ConfigBuilder) ToUpdateAction() clientgotesting.UpdateActionImpl {
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.

Feels like this should be part of an interface this implements

@dprotaso
Copy link
Copy Markdown
Member Author

Will revisit later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants