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

add simple tests #42

Merged
merged 11 commits into from
Mar 14, 2023
Merged

add simple tests #42

merged 11 commits into from
Mar 14, 2023

Conversation

jmnote
Copy link
Contributor

@jmnote jmnote commented Mar 14, 2023

What this PR does / why we need it (변경 내용 / 필요성):

간단한 테스트를 추가하여 커버리지를 높혔습니다.

make test-cover를 추가하여 커버리지를 미리 확인할 수 있게 하였습니다.

Which issue(s) this PR fixes (관련 이슈):

none

Special notes for your reviewer (리뷰어에게 하고 싶은 말):

리뷰 감사합니다.

Additional documentation, usage docs, etc. (기타 관련 문서, 사용법 등):

사용 예시

user01@localhost:~/workspaces/lethe$ make test-cover
./scripts/test-cover.sh
ok      github.com/kuoss/lethe  0.027s  coverage: 66.7% of statements
?       github.com/kuoss/lethe/cli/cmd  [no test files]
?       github.com/kuoss/lethe/cli/cmd/list     [no test files]
?       github.com/kuoss/lethe/cli/cmd/task     [no test files]
?       github.com/kuoss/lethe/cli/util [no test files]
?       github.com/kuoss/lethe/handlers [no test files]
?       github.com/kuoss/lethe/storage  [no test files]
?       github.com/kuoss/lethe/storage/driver/factory   [no test files]
?       github.com/kuoss/lethe/storage/driver   [no test files]
?       github.com/kuoss/lethe/util     [no test files]
ok      github.com/kuoss/lethe/cli      3.066s  coverage: 0.0% of statements
ok      github.com/kuoss/lethe/clock    0.009s  coverage: 100.0% of statements
ok      github.com/kuoss/lethe/config   0.007s  coverage: 81.0% of statements
ok      github.com/kuoss/lethe/letheql  0.025s  coverage: 73.0% of statements
ok      github.com/kuoss/lethe/logs     0.069s  coverage: 47.7% of statements
ok      github.com/kuoss/lethe/storage/driver/filesystem        0.005s  coverage: 10.4% of statements
ok      github.com/kuoss/lethe/testutil 0.008s  coverage: 79.7% of statements

✔️ PASS ( test coverage: 52.0% >= 50.0% )

전체 커버리지가 일정한 값(50.0%) 이상이면 ✔️ PASS 그렇지 않으면 ❌ FAIL로 보여줍니다.

@jmnote jmnote requested a review from dozer-jang March 14, 2023 05:09
@jmnote jmnote self-assigned this Mar 14, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2023

Codecov Report

Patch coverage has no change and project coverage change: +5.50 🎉

Comparison is base (8598f3e) 40.38% compared to head (d01b125) 45.89%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
+ Coverage   40.38%   45.89%   +5.50%     
==========================================
  Files          20       24       +4     
  Lines        1186     1266      +80     
==========================================
+ Hits          479      581     +102     
+ Misses        646      614      -32     
- Partials       61       71      +10     

see 7 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@dozer-jang dozer-jang left a comment

Choose a reason for hiding this comment

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

configPatterendString 타입에 대한 테스트코드 감사합니다.

근데 import 패키지 정렬 순만 틀려도 go fmt가 fail이 나네요. IDE에서 go fmt를 수행하고 커밋하는 룰을 정해야 할 것 같습니다. 저는 Goland에서 setting > Before Commit > go fmt 적용하도록 해놓겠습니다.

@jmnote jmnote changed the title Increased coverage by adding simple tests add simple tests Mar 14, 2023
@jmnote
Copy link
Contributor Author

jmnote commented Mar 14, 2023

네 암튼 확인이 되니까 사후에 make checks를 한번 돌려주면 되고요.
그래서 이제 All checks have passed...
단, make test-cover는 54.6%, coverall은 51.5%로 차이가 있네요.

PR 등록시 reviewer를 비워놨다가
All checks have passed가 뜨면 reviewer를 할당하는 것도 좋을 것 같아요.

Copy link
Contributor

@dozer-jang dozer-jang left a comment

Choose a reason for hiding this comment

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

모든 workflow 통과 확인했습니다 감사합니다

@jmnote
Copy link
Contributor Author

jmnote commented Mar 14, 2023

리뷰 감사합니다. merge합니다.

@jmnote jmnote merged commit b08f269 into main Mar 14, 2023
@jmnote jmnote deleted the test-coverage-up branch March 14, 2023 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants