Skip to content

Introduce upgrade command unit tests#2639

Merged
siggy merged 1 commit intomasterfrom
siggy/upgrade-unit
Apr 5, 2019
Merged

Introduce upgrade command unit tests#2639
siggy merged 1 commit intomasterfrom
siggy/upgrade-unit

Conversation

@siggy
Copy link
Member

@siggy siggy commented 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 siggy self-assigned this Apr 5, 2019
@siggy siggy force-pushed the siggy/upgrade-unit branch 2 times, most recently from 41e7a36 to b7deb41 Compare April 5, 2019 00:32
@siggy siggy requested a review from olix0r April 5, 2019 00:34
@siggy siggy force-pushed the siggy/upgrade-unit branch from b7deb41 to 1efead7 Compare April 5, 2019 00:36
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 siggy force-pushed the siggy/upgrade-unit branch from 1efead7 to f8b8028 Compare April 5, 2019 00:43
@l5d-bot
Copy link
Collaborator

l5d-bot commented Apr 5, 2019

Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

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

⭐️ 🎉 Hooray for more tests!

@siggy siggy merged commit 1c938b3 into master Apr 5, 2019
@siggy siggy deleted the siggy/upgrade-unit branch April 5, 2019 18:55
@admc admc mentioned this pull request Apr 5, 2019
25 tasks
KatherineMelnyk pushed a commit to KatherineMelnyk/linkerd2 that referenced this pull request 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 siggy mentioned this pull request Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants