-
Notifications
You must be signed in to change notification settings - Fork 65
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
add new component types to test utils #496
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: amisevsk, kim-tsao The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -43,6 +43,12 @@ func (devfile *TestDevfile) AddComponent(componentType schema.ComponentType) sch | |||
if componentType == schema.ContainerComponentType { | |||
component = devfile.createContainerComponent() | |||
devfile.SetContainerComponentValues(&component) | |||
} else if componentType == schema.KubernetesComponentType { | |||
component = devfile.createKubernetesComponent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking perhaps we don't need to split those component creation into sub function calls.
Those function call are almost identical, except for the part of creating an empty component.
can combine those sub function calls within this AddComponent
component = devfile.createKubernetesComponent() | |
func (devfile *TestDevfile) AddComponent(componentType schema.ComponentType) schema.Component { | |
LogInfoMessage("Create a %v component :", componentType) | |
component := schema.Component{} | |
component.Name = GetRandomUniqueString(8, true) | |
LogInfoMessage(fmt.Sprintf("....... Name: %s", component.Name)) | |
switch componentType{ | |
case schema.ContainerComponentType: | |
component.Container = &schema.ContainerComponent{} | |
devfile.SetContainerComponentValues(&component) | |
...... // cases for other component types | |
} | |
devfile.componentAdded(component) | |
return component | |
} |
Same for AddCommand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kim-tsao I guess I'm late for this PR..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yangcao77 sorry I missed this! I appreciate your feedback anyhow so I'll try to apply your suggestion next time, thanks.
What does this PR do?
Adds the kubernetes and openshift component types to the test utils for improved coverage. Corresponding changes in library repo will be added once this PR has been approved and merged.
What issues does this PR fix or reference?
#495
Is your PR tested? Consider putting some instruction how to test your changes
Yes, I manually ran the
go test -v
commands locally against the api and library repos to ensure there were no regressionsDocs PR
N/A