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

Rewrite tests for tableprinter.go #82054

Merged
merged 1 commit into from
Sep 11, 2019

Conversation

seans3
Copy link
Contributor

@seans3 seans3 commented Aug 28, 2019

  • Adds significant tests for tableprinter.go in preparation for moving this file out of Kubernetes core.
  • Improves unit test coverage for tableprinter.go from 17.2% to 82.4%.
  • Concentrates on validating the exported PrintObj() function which transforms (mostly) Tables to strings.
  • Also focuses on how PrintOptions affects printing output.
  • Removes previous test which exercised non-exported function

/kind cleanup
/sig cli
/area kubectl
/area code-organization
/priority important-soon

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. sig/cli Categorizes an issue or PR as relevant to SIG CLI. area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/code-organization Issues or PRs related to kubernetes code organization priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 28, 2019
@miguelbernadi
Copy link
Contributor

Is there any reason not to use subtests for these? They usually help in identifying which case fails, and may also enable running tests in Parallel which can detect issues if the code tested is expected to run in parallel. Here's a blogpost on its tradeoffs: https://jayson.dev/blog/2019/06/table-driven-golang-subtests/

@seans3 seans3 force-pushed the table-printer-tests branch 2 times, most recently from 9519632 to 4eac893 Compare August 28, 2019 16:57
@seans3
Copy link
Contributor Author

seans3 commented Aug 28, 2019

/assign @liggitt

@liggitt
Copy link
Member

liggitt commented Aug 29, 2019

one nit, lgtm otherwise

@liggitt
Copy link
Member

liggitt commented Aug 29, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 29, 2019
@liggitt
Copy link
Member

liggitt commented Aug 29, 2019

/retest

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, seans3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@seans3
Copy link
Contributor Author

seans3 commented Aug 29, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit 2b7ceb2 into kubernetes:master Sep 11, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/code-organization Issues or PRs related to kubernetes code organization area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants