Skip to content

test: add unit test for error scenario in internal/credential/store.go#982

Merged
qweeah merged 2 commits into
oras-project:mainfrom
enraiha0307:store-file-code-coverage
Jul 12, 2023
Merged

test: add unit test for error scenario in internal/credential/store.go#982
qweeah merged 2 commits into
oras-project:mainfrom
enraiha0307:store-file-code-coverage

Conversation

@enraiha0307

Copy link
Copy Markdown
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
Comment thread internal/credential/store.go Outdated
Comment thread internal/credential/store.go Outdated
@enraiha0307 enraiha0307 force-pushed the store-file-code-coverage branch from 5f33119 to 08cfc6f Compare June 21, 2023 08:47
@codecov-commenter

codecov-commenter commented Jun 21, 2023

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.08%. Comparing base (ed3fbcc) to head (70bac9c).
⚠️ Report is 586 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #982      +/-   ##
==========================================
+ Coverage   80.97%   81.08%   +0.10%     
==========================================
  Files          57       57              
  Lines        2907     2907              
==========================================
+ Hits         2354     2357       +3     
+ Misses        378      376       -2     
+ Partials      175      174       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shizhMSFT shizhMSFT modified the milestones: v1.1.0, v1.2.0 Jun 28, 2023
Comment thread internal/credential/store_test.go
Comment thread internal/credential/store_test.go Outdated

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with nitpicks

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

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

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.

@enraiha0307 enraiha0307 force-pushed the store-file-code-coverage branch from 70d6840 to 9136a50 Compare June 29, 2023 15:26
Comment thread internal/credential/store_test.go Outdated
@enraiha0307 enraiha0307 force-pushed the store-file-code-coverage branch from 9136a50 to 57011ec Compare June 30, 2023 04:16
Comment thread internal/credential/store_test.go Outdated
Comment thread internal/credential/store_test.go
Comment thread internal/credential/store_test.go Outdated
@enraiha0307 enraiha0307 force-pushed the store-file-code-coverage branch from 57011ec to ea6e802 Compare July 7, 2023 12:44

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with suggestions

Comment thread internal/credential/store_test.go Outdated
Comment thread internal/credential/store_test.go Outdated
Comment thread internal/credential/store_test.go Outdated
@enraiha0307 enraiha0307 force-pushed the store-file-code-coverage branch from ea6e802 to 7d8ce2c Compare July 10, 2023 08:48

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@qweeah qweeah force-pushed the store-file-code-coverage branch from 7d8ce2c to 88ae475 Compare July 12, 2023 00:40
Signed-off-by: Akanksha Gahalot <akankshagahlot0307@gmail.com>
Signed-off-by: Akanksha Gahalot <akankshagahlot0307@gmail.com>
@qweeah qweeah force-pushed the store-file-code-coverage branch from 88ae475 to 70bac9c Compare July 12, 2023 00:47

@qweeah qweeah left a comment

Copy link
Copy Markdown
Contributor

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

No open projects

Development

Successfully merging this pull request may close these issues.

5 participants