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

Add helper functions for e2e tests #198

Merged
merged 4 commits into from
Nov 6, 2019

Conversation

tpantelis
Copy link
Contributor

Added some helper functions for upcoming e2e enhancements.

Signed-off-by: Tom Pantelis tompantelis@gmail.com

Copy link
Contributor

@mangelajo mangelajo left a comment

Choose a reason for hiding this comment

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

Some comments, although mostly naming nits, the refactors/new function look good.

Copy link
Contributor

@Jaanki Jaanki left a comment

Choose a reason for hiding this comment

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

Some comments above.

return
}

func (f *Framework) SetGatewayLabelOnNode(cluster ClusterIndex, nodeName string, isGateway bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding a "UnsetGatewayLabelOnNode" for remove cluster test use case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could have 2 separate functions, one to set to true, other set to false instead of 1. 2 ways of doing it - matter of opinion I guess. I think the single function will suffice - we'd still need it anyway for reuse with the set-to-true and set-to-false functions as syntactic sugar on top.

Copy link
Contributor

Choose a reason for hiding this comment

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

Using the same function with isGateway "true" or "false" is enough. Renaming the function to "ToggleGatewayLabelOnNode" would be more appropriate.

This is not something that needs urgent change.

Rest of the patch looks good.

Copy link
Contributor

Choose a reason for hiding this comment

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

Set is better here, toggle implies that you don’t pass true/false and It will switch the existing state.

Added some helper functions for upcoming e2e enhancements.

Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
- Renamed FindNodes to FindNodesByGatewayLabel and changed to return an array of Nodes
- Added function doc coomments

Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
@tpantelis
Copy link
Contributor Author

Pushed 1d41096 to change FindNodes to FindNodesByGatewayLabel.

return
}

func (f *Framework) SetGatewayLabelOnNode(cluster ClusterIndex, nodeName string, isGateway bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the same function with isGateway "true" or "false" is enough. Renaming the function to "ToggleGatewayLabelOnNode" would be more appropriate.

This is not something that needs urgent change.

Rest of the patch looks good.

Copy link
Contributor

@mangelajo mangelajo left a comment

Choose a reason for hiding this comment

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

Thanks a lot Thomas!

@mangelajo mangelajo merged commit 5fb8f2e into submariner-io:master Nov 6, 2019
@tpantelis tpantelis deleted the e2e_helpers branch December 2, 2019 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants