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 test for error scenario in internal/credential/store.go #982

Merged
merged 2 commits into from
Jul 12, 2023

Conversation

enraiha0307
Copy link
Contributor

What this PR does / why we need it:
This PR adds a unit test file for internal/credential/store.go to increase its code coverage from 78.57% 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?

@shizhMSFT shizhMSFT changed the title adding unit test for error scenario in internal/credential/store.go file test: add unit test for error scenario in internal/credential/store.go Jun 20, 2023
internal/credential/store.go Outdated Show resolved Hide resolved
internal/credential/store.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2023

Codecov Report

Merging #982 (ea6e802) into main (7fc68d4) will increase coverage by 0.17%.
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     #982      +/-   ##
==========================================
+ Coverage   81.09%   81.26%   +0.17%     
==========================================
  Files          57       57              
  Lines        2904     2904              
==========================================
+ Hits         2355     2360       +5     
+ Misses        375      371       -4     
+ Partials      174      173       -1     

see 2 files with indirect coverage changes

@shizhMSFT shizhMSFT modified the milestones: v1.1.0, v1.2.0 Jun 28, 2023
internal/credential/store_test.go Outdated Show resolved Hide resolved
internal/credential/store_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM with nitpicks

internal/credential/store_test.go Show resolved Hide resolved
internal/credential/store_test.go Outdated Show resolved Hide resolved
internal/credential/store_test.go Outdated Show resolved Hide resolved
@enraiha0307 enraiha0307 force-pushed the store-file-code-coverage branch 3 times, most recently from 735d053 to 70d6840 Compare June 29, 2023 14:22
@shizhMSFT shizhMSFT self-requested a review June 29, 2023 15:08
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

Request changes for using t.TempDir for temp folder / file creation.

internal/credential/store_test.go Show resolved Hide resolved
internal/credential/store_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM with suggestions

internal/credential/store_test.go Outdated Show resolved Hide resolved
internal/credential/store_test.go Outdated Show resolved Hide resolved
internal/credential/store_test.go Outdated Show resolved Hide resolved
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

Signed-off-by: Akanksha Gahalot <akankshagahlot0307@gmail.com>
Signed-off-by: Akanksha Gahalot <akankshagahlot0307@gmail.com>
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

@qweeah qweeah merged commit 21d0b71 into oras-project:main Jul 12, 2023
qweeah pushed a commit to qweeah/oras that referenced this pull request Jul 21, 2023
…go` (oras-project#982)

Signed-off-by: Akanksha Gahalot <akankshagahlot0307@gmail.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah pushed a commit to qweeah/oras that referenced this pull request Jul 21, 2023
…go` (oras-project#982)

Signed-off-by: Akanksha Gahalot <akankshagahlot0307@gmail.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah qweeah modified the milestones: v1.2.0, v1.1.0 Aug 1, 2023
shizhMSFT pushed a commit to shizhMSFT/oras that referenced this pull request Aug 3, 2023
…go` (oras-project#982)

Signed-off-by: Akanksha Gahalot <akankshagahlot0307@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

5 participants