Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Adding tests for validating remove-clusters command flags #152

Merged

Conversation

nikhiljindal
Copy link
Contributor

Follow up to #146.

Adding tests to verify flags are validated as expected. This is similar to tests for other commands.

cc @csbell @G-Harmon @perotinus

@nikhiljindal
Copy link
Contributor Author

@perotinus Can you please review this one?

"github.com/GoogleCloudPlatform/k8s-multicluster-ingress/app/kubemci/pkg/kubeutils"
)

// Test to verify validate.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Go style is to have the function name as the first word in the comment.

TestValidateRemoveClusterArgs tests all flags...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

func TestValidateRemoveClustersArgs(t *testing.T) {
// validateRemoveClustersArgs should return an error with empty options.
options := removeClustersOptions{}
if err := validateRemoveClustersArgs(&options, []string{}); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it could be a table-style test. But I suppose that could come in a follow-up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

@perotinus
Copy link
Contributor

/lgtm unless you want to modify to table-based tests.

@nikhiljindal
Copy link
Contributor Author

Thanks @perotinus
Updated as per comments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants