Use the builder pattern to improve readability of configuration table testing#1924
Use the builder pattern to improve readability of configuration table testing#1924dprotaso wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dprotaso If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/assign @mattmoor @grantr @jonjohnsonjr |
d260f36 to
bd83052
Compare
| obj *v1alpha1.Configuration | ||
| } | ||
|
|
||
| func Config(name, namespace string) ConfigBuilder { |
There was a problem hiding this comment.
I'm going to swap this to be (namespace, name string) to be consistent with revision & route table tests
5430735 to
8e280ed
Compare
|
/hold Going to experiment a bit further with some things |
|
|
||
| func (bldr ConfigBuilder) ToChildBuild(convert ConfigToBuildFunc) *buildv1alpha1.Build { | ||
| return convert(bldr.Build()) | ||
| } |
There was a problem hiding this comment.
Feels like this should maybe return a BuildBuilder, WDYT?
| return RevisionBuilder{convert(bldr.Build())} | ||
| } | ||
|
|
||
| func (bldr ConfigBuilder) ToUpdateAction() clientgotesting.UpdateActionImpl { |
There was a problem hiding this comment.
Feels like this should be part of an interface this implements
|
Will revisit later |
From the PoC (#1762) this is the cleanup for the configuration table test
Will focus on revision & route next.