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

Enable tests that were not being run #732

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

marckhouzam
Copy link
Contributor

@marckhouzam marckhouzam commented Apr 13, 2024

What this PR does / why we need it

I noticed that the ginko tests in pkg/config did not have a test suite and therefore were not being run.

Before this PR, notice the [no tests to run].
The test coverage happens because the init() function is automatically run, but nothing is verified, so it is not real test coverage.

$ cd tanzu-cli
~tc
$ g co main
Switched to branch 'main'
Your branch is up to date with 'upstream/main'.
$ go test ./pkg/config -coverprofile coverage.txt
ok  	github.com/vmware-tanzu/tanzu-cli/pkg/config	0.634s	coverage: 12.2% of statements [no tests to run]

With this PR, notice the increased coverage and the fact that it no longer says [no tests to run]:

$ go test ./pkg/config -coverprofile coverage.txt
ok  	github.com/vmware-tanzu/tanzu-cli/pkg/config	1.010s	coverage: 36.7% of statements

Which issue(s) this PR fixes

Fixes # N/A

Describe testing done for PR

Let CI run

Release note

More unit tests

Additional information

Special notes for your reviewer

@marckhouzam marckhouzam requested a review from a team as a code owner April 13, 2024 02:54
@marckhouzam marckhouzam added this to the v1.3.0 milestone Apr 13, 2024
Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

Thanks for catching this. 👍

@marckhouzam marckhouzam merged commit 90ca3fe into vmware-tanzu:main Apr 15, 2024
8 checks passed
@marckhouzam marckhouzam deleted the fix/runConfigUnitTests branch April 15, 2024 17:50
vuil pushed a commit to vuil/tanzu-cli that referenced this pull request Apr 19, 2024
vuil pushed a commit that referenced this pull request Apr 19, 2024
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