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

ci(codecov): upload coverage #65

Merged
merged 1 commit into from
Apr 21, 2024
Merged

ci(codecov): upload coverage #65

merged 1 commit into from
Apr 21, 2024

Conversation

manudeli
Copy link
Member

@manudeli manudeli commented Apr 19, 2024

close #63

Overview

  1. Codecov GitHub bot을 추가해주세요 https://github.com/apps/codecov
    이제부터 이렇게 comment로 변경사항을 체크하고 목표 테스트 커버리지(90%로 설정해둠(목표: 100%, threshold: 10%))가 넘지 않으면 github status check에서 x로 막게 됩니다. 기여자도 테스트코드를 작성하기 위한 동기부여를 더 받을 수 있고 메인테이너도 쉽게 해당 변경으로 인한 테스트 커버리지를 빠르게 파악할 수 있게 됩니다
image 2. codecov에 organization과 이 레포지토리가 등록되야 해요 이 PR이 머지되면 설정이 되면서 커버리지를 트래킹하게 됩니다. image
  1. 머지전에 업로드용 CODECOV_TOKEN추가가 필요해요
    업로드를 위해 토큰이 필요합니다

PR Checklist

  • I read and included theses actions below
  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.

Copy link

changeset-bot bot commented Apr 19, 2024

⚠️ No Changeset found

Latest commit: 0c325fa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 19, 2024

@manudeli is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

netlify bot commented Apr 19, 2024

Deploy Preview for es-hangul ready!

Name Link
🔨 Latest commit 0c325fa
🔍 Latest deploy log https://app.netlify.com/sites/es-hangul/deploys/66222c154b3c4c0008b76dd6
😎 Deploy Preview https://deploy-preview-65--es-hangul.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

- run: yarn test
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

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

secret에 추가필요

Copy link
Member Author

@manudeli manudeli left a comment

Choose a reason for hiding this comment

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

의도를 남겨요

Comment on lines +40 to +41
"test": "vitest run --coverage --typecheck",
"test:watch": "vitest --ui --coverage --typecheck",
Copy link
Member Author

Choose a reason for hiding this comment

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

  1. test coverage와 typecheck을 위해 viteset option을 추가합니다.
  2. vitest/ui를 사용해 watch모드인 경우 쉽게 해당 테스트 문제를 파악하고 커버리지를 파악할 수 있게 됩니다.

Comment on lines +8 to +11
coverage: {
provider: 'istanbul',
include: ['src/**/*'],
},
Copy link
Member Author

Choose a reason for hiding this comment

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

test coverage를 측정하기 시작합니다

Comment on lines +6 to +7
target: 100%
threshold: 10%
Copy link
Member Author

Choose a reason for hiding this comment

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

테스트 커버리지 목표: 100% threshold 10%라서 90%의 테스트 커버리가 넘지 못하는 PR은 PR status check에서 x를 받게 됩니다

Comment on lines +12 to +13
ignore:
- '**/*.test-d.*'
Copy link
Member Author

Choose a reason for hiding this comment

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

codecov에서 test-d파일은 아직 테스트코드로 보지 않고 있습니다. 하지만 test-d는 vitest에서 타입테스트를 위해서 사용되고 있습니다. 커버율에 포함되지 않게 처리했습니다.

@manudeli manudeli marked this pull request as ready for review April 19, 2024 08:46
@okinawaa okinawaa self-requested a review April 21, 2024 14:08
@okinawaa
Copy link
Member

secrets에 CODECOV_TOKEN라는 이름으로 추가해뒀어요!

Copy link
Member

@okinawaa okinawaa left a comment

Choose a reason for hiding this comment

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

너무 좋은 PR이라고 생각해요!
말씀해주신대로, 테스트 코드에 대한 동기부여를 향상 시켜주는 도구라고 생각해요!
감사합니당~!

@okinawaa okinawaa merged commit 28f1499 into toss:main Apr 21, 2024
5 of 6 checks passed
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.

[Feature]: Codecov 설정 필요
3 participants