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

tests: cmd unit test version #10689

Merged
merged 9 commits into from Sep 27, 2022
Merged

Conversation

emirot
Copy link
Contributor

@emirot emirot commented Sep 24, 2022

Adding unit test on client version and small refactoring.

As there is no previous tests, some manual testing to make sure it didn't break anything:

make cli-local
cd dist
./argocd version
./argocd version --client
./argocd version --short --client

Signed-off-by: emirot <emirot.nolan@gmail.com>
Signed-off-by: emirot <emirot.nolan@gmail.com>
Signed-off-by: emirot <emirot.nolan@gmail.com>
@emirot emirot changed the title Cmd/unit test version tests: Cmd/unit test version Sep 24, 2022
@emirot emirot changed the title tests: Cmd/unit test version tests: cmd unit test version Sep 24, 2022
@codecov
Copy link

codecov bot commented Sep 24, 2022

Codecov Report

Base: 45.76% // Head: 45.87% // Increases project coverage by +0.11% 🎉

Coverage data is based on head (8cd01d7) compared to base (6fd4c6f).
Patch coverage: 27.27% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10689      +/-   ##
==========================================
+ Coverage   45.76%   45.87%   +0.11%     
==========================================
  Files         236      236              
  Lines       28529    28530       +1     
==========================================
+ Hits        13055    13087      +32     
+ Misses      13669    13637      -32     
- Partials     1805     1806       +1     
Impacted Files Coverage Δ
cmd/argocd/commands/version.go 34.09% <27.27%> (+34.09%) ⬆️
util/settings/settings.go 51.36% <0.00%> (ø)
cmd/argocd/commands/root.go 5.88% <0.00%> (+3.92%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: emirot <emirot.nolan@gmail.com>
Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

Thanks a lot @emirot!

Didn't know that cobra provides some of those methods that can be leveraged to actually write some proper unit tests for commands. TIL :)

I have one minor request for change regarding the unit test, please see below.

cmd/argocd/commands/version_test.go Outdated Show resolved Hide resolved
@emirot emirot requested a review from jannfis September 26, 2022 17:17
Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @emirot !

@jannfis jannfis merged commit 65804bb into argoproj:master Sep 27, 2022
ashutosh16 pushed a commit to ashutosh16/argo-cd that referenced this pull request Oct 7, 2022
* tests: add unit test version command

Signed-off-by: emirot <emirot.nolan@gmail.com>

* tests: add unit test version command

Signed-off-by: emirot <emirot.nolan@gmail.com>

* tests: add unit test version command

Signed-off-by: emirot <emirot.nolan@gmail.com>

* tests: add unit test version command

Signed-off-by: emirot <emirot.nolan@gmail.com>

* tests: add unit test version command

Signed-off-by: emirot <emirot.nolan@gmail.com>

* tests: client version

Signed-off-by: emirot <emirot.nolan@gmail.com>

Signed-off-by: emirot <emirot.nolan@gmail.com>
@emirot emirot deleted the cmd/unit_test_version branch October 25, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants