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

upgrade command unit tests #2637

Closed
siggy opened this issue Apr 4, 2019 · 3 comments
Closed

upgrade command unit tests #2637

siggy opened this issue Apr 4, 2019 · 3 comments
Assignees

Comments

@siggy
Copy link
Member

siggy commented Apr 4, 2019

#2564 introduced the linkerd upgrade command, with most of the new code in cli/cmd/upgrade.go. Add unit tests for this.

Note that linkerd upgrade tests could leverage functionality described in #2629, where upgrade information is read from a file rather than from Kubernetes.

Part of #2459

@admc admc mentioned this issue Apr 4, 2019
25 tasks
@siggy siggy self-assigned this Apr 4, 2019
siggy added a commit that referenced this issue Apr 5, 2019
This change introduce a basic unit test for the `linkerd upgrade`
command. Given a mock k8s client with linkerd-config and
linkerd-identity-issuer objects, it validates the rendered yaml output
against an expected file.

To enable this testing, most of the logic in the top-level upgrade
command has been moved down into a `validateAndBuild` method.

TODO:
- test individual functions around mutating options, flags, configs, and
  values
- enable reading the install information from a manifest rather than k8s

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this issue Apr 5, 2019
This change introduce a basic unit test for the `linkerd upgrade`
command. Given a mock k8s client with linkerd-config and
linkerd-identity-issuer objects, it validates the rendered yaml output
against an expected file.

To enable this testing, most of the logic in the top-level upgrade
command has been moved down into a `validateAndBuild` method.

TODO:
- test individual functions around mutating options, flags, configs, and
  values
- enable reading the install information from a manifest rather than k8s

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this issue Apr 5, 2019
This change introduce a basic unit test for the `linkerd upgrade`
command. Given a mock k8s client with linkerd-config and
linkerd-identity-issuer objects, it validates the rendered yaml output
against an expected file.

To enable this testing, most of the logic in the top-level upgrade
command has been moved down into a `validateAndBuild` method.

TODO:
- test individual functions around mutating options, flags, configs, and
  values
- enable reading the install information from a manifest rather than k8s

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this issue Apr 5, 2019
This change introduce a basic unit test for the `linkerd upgrade`
command. Given a mock k8s client with linkerd-config and
linkerd-identity-issuer objects, it validates the rendered yaml output
against an expected file.

To enable this testing, most of the logic in the top-level upgrade
command has been moved down into a `validateAndBuild` method.

TODO:
- test individual functions around mutating options, flags, configs, and
  values
- enable reading the install information from a manifest rather than k8s

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this issue Apr 5, 2019
This change introduces a basic unit test for the `linkerd upgrade`
command. Given a mock k8s client with linkerd-config and
linkerd-identity-issuer objects, it validates the rendered yaml output
against an expected file.

To enable this testing, most of the logic in the top-level upgrade
command has been moved down into a `validateAndBuild` method.

TODO:
- test individual functions around mutating options, flags, configs, and
  values
- enable reading the install information from a manifest rather than k8s

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this issue Apr 5, 2019
This change introduces a basic unit test for the `linkerd upgrade`
command. Given a mock k8s client with linkerd-config and
linkerd-identity-issuer objects, it validates the rendered yaml output
against an expected file.

To enable this testing, most of the logic in the top-level upgrade
command has been moved down into a `validateAndBuild` method.

TODO:
- test individual functions around mutating options, flags, configs, and
  values
- enable reading the install information from a manifest rather than k8s

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
KatherineMelnyk pushed a commit to KatherineMelnyk/linkerd2 that referenced this issue Apr 5, 2019
This change introduces a basic unit test for the `linkerd upgrade`
command. Given a mock k8s client with linkerd-config and
linkerd-identity-issuer objects, it validates the rendered yaml output
against an expected file.

To enable this testing, most of the logic in the top-level upgrade
command has been moved down into a `validateAndBuild` method.

TODO:
- test individual functions around mutating options, flags, configs, and
  values
- enable reading the install information from a manifest rather than k8s

Part of linkerd#2637

Signed-off-by: Andrew Seigner <[email protected]>
Signed-off-by: [email protected] <[email protected]>
siggy added a commit that referenced this issue Apr 6, 2019
This change introduces some unit tests on individual methods in the
upgrade code path, along with some minor cleanup.

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
@olix0r
Copy link
Member

olix0r commented Apr 8, 2019

I think this is done now? @siggy ?

@siggy
Copy link
Member Author

siggy commented Apr 8, 2019

@olix0r I have a branch that continues this work: https://github.com/linkerd/linkerd2/tree/siggy/update-upgrade-unit

The goal of the initial PR, #2639, was to introduce unit tests but minimize implementation changes. Now that we have some basic unit testing, we have a bit more flexibility to move things around further, in service to testing.

There's a bit more info in the checklist in #2459.

siggy added a commit that referenced this issue Apr 9, 2019
This change introduces some unit tests on individual methods in the
upgrade code path, along with some minor cleanup.

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this issue Apr 9, 2019
This change introduces some unit tests on individual methods in the
upgrade code path, along with some minor cleanup.

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this issue Apr 10, 2019
This change introduces some unit tests on individual methods in the
upgrade code path, along with some minor cleanup.

Part of #2637

Signed-off-by: Andrew Seigner <[email protected]>
@siggy
Copy link
Member Author

siggy commented Apr 10, 2019

Closing via #2639 #2672.

Subsequent work will be tracked via #2629.

@siggy siggy closed this as completed Apr 10, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants