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

test: add unit-tests for internal/version.go #977

Merged
merged 4 commits into from
Jun 21, 2023

Conversation

enraiha0307
Copy link
Contributor

What this PR does / why we need it:
This PR adds a unit test file for internal/version/version.go to increase its code coverage from 40% to 100%.
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #
This PR is a small part of #972

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

@enraiha0307 enraiha0307 force-pushed the version-file-code-coverage branch from 254571b to 01fc19f Compare June 19, 2023 05:41
internal/version/version_test.go Outdated Show resolved Hide resolved
internal/version/version_test.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 19, 2023

Codecov Report

Merging #977 (eb8e789) into main (22a7316) will increase coverage by 0.10%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #977      +/-   ##
==========================================
+ Coverage   81.08%   81.19%   +0.10%     
==========================================
  Files          53       53              
  Lines        2776     2776              
==========================================
+ Hits         2251     2254       +3     
+ Misses        356      354       -2     
+ Partials      169      168       -1     

see 1 file with indirect coverage changes

@enraiha0307
Copy link
Contributor Author

@TerryHowe I've done the requested changes, please review.

go.mod Outdated Show resolved Hide resolved
Signed-off-by: Akanksha Gahalot <[email protected]>
@enraiha0307
Copy link
Contributor Author

@qweeah review comments resolved, please review.

Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

@shizhMSFT shizhMSFT changed the title Added unit-tests for internal/version.go test: add unit-tests for internal/version.go Jun 20, 2023
Copy link
Contributor

@qweeah qweeah left a comment

Choose a reason for hiding this comment

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

LGTM @enraiha0307 can you help rebase the PR?

@enraiha0307
Copy link
Contributor Author

Yes, I'll do that.

@qweeah qweeah merged commit bf33bb7 into oras-project:main Jun 21, 2023
shizhMSFT pushed a commit to shizhMSFT/oras that referenced this pull request Aug 3, 2023
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.

4 participants