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

integration_test: add more test cases #297

Merged
merged 2 commits into from
Jul 23, 2019

Conversation

ahmetb
Copy link
Member

@ahmetb ahmetb commented Jul 23, 2019

Added more tests or expanded existing tests to:

  • cover args/stdin handling edge cases for install cmd
  • cover status code of re-runs of install, update, and remove
  • cover status when index not initialized in remove, upgrade and install
  • several other minor adjustments

Fixes #294
Fixes #295

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 23, 2019
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 23, 2019
Added more tests or expanded existing tests to:

- cover args/stdin handling edge cases for `install` cmd
- cover status code of re-runs of `install`, `update`, and `remove`.
- cover status when index not initialized in `remove`, `upgrade`, `install`
- several other minor adjustments

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
@codecov-io
Copy link

codecov-io commented Jul 23, 2019

Codecov Report

Merging #297 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #297   +/-   ##
=======================================
  Coverage   56.22%   56.22%           
=======================================
  Files          19       19           
  Lines         891      891           
=======================================
  Hits          501      501           
  Misses        337      337           
  Partials       53       53

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86a9199...528968f. Read the comment docs.

Copy link
Contributor

@corneliusweig corneliusweig left a comment

Choose a reason for hiding this comment

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

Nice work, looks excellent.

Of the points listed in the referenced issues, I cannot find anything about

list: test if plugin names can be saved to a file properly when STDOUT is
not a tty (i.e. 'backup' use case)

Was that intentional? Myself, I cannot think of a way how to get proper output for ttys, so it looks not testable to me.


test, cleanup := NewTest(t)
defer cleanup()

test.WithIndex().Krew("install", validPlugin).RunOrFailOutput()
test.WithIndex().Krew("install", validPlugin, validPlugin2).RunOrFailOutput()

This comment was marked as resolved.

@ahmetb
Copy link
Member Author

ahmetb commented Jul 23, 2019

Was that intentional? Myself, I cannot think of a way how to get proper output for ttys, so it looks not testable to me.

I think krew list > file.txt is supposed to be printing only names (not a table). Let's check.

@ahmetb
Copy link
Member Author

ahmetb commented Jul 23, 2019

yep:

k krew list | cat
get-all
konfig
krew
mtail
view-secret
who-can

I'll add a test for this as well.

@ahmetb
Copy link
Member Author

ahmetb commented Jul 23, 2019

krew list is actually tested fine, I'm now updating its tests to be more precise.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
@ahmetb
Copy link
Member Author

ahmetb commented Jul 23, 2019

Fixed now.

@corneliusweig
Copy link
Contributor

You are really lifting krew's code quality to the next level. 👏 for your efforts!
/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 Jul 23, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, corneliusweig

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:
  • OWNERS [ahmetb,corneliusweig]

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

@k8s-ci-robot k8s-ci-robot merged commit a89c34b into kubernetes-sigs:master Jul 23, 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
4 participants