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 a check to make sure unit tests are considered when changing code #10337

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

ChenyuLInx
Copy link
Contributor

@ChenyuLInx ChenyuLInx commented Jun 18, 2024

resolves #10329

For new code checked in, we require 75% unittest coverage. We can always adjust if it becomes too noisy.
Docs about component https://about.codecov.io/blog/codecov-components-breaking-down-coverage-by-filters/

@cla-bot cla-bot bot added the cla:yes label Jun 18, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should refactor https://github.com/dbt-labs/actions/blob/main/.github/workflows/changelog-existence.yml#L2 a bit to make it more generalized and use it here.
@emmyoop WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.81%. Comparing base (4415731) to head (e06ed29).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10337      +/-   ##
==========================================
+ Coverage   88.78%   88.81%   +0.02%     
==========================================
  Files         180      180              
  Lines       22490    22486       -4     
==========================================
+ Hits        19967    19970       +3     
+ Misses       2523     2516       -7     
Flag Coverage Δ
integration 86.13% <ø> (+0.09%) ⬆️
unit 62.19% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.19% <ø> (-0.01%) ⬇️
Integration Tests 86.13% <ø> (+0.09%) ⬆️

uses: actions/github-script@v7
with:
script: core.setFailed('Unit Test required to merge.')
uses: dbt-labs/actions/.github/workflows/check-change-and-comment.yml@main
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the new action things should look much easier.
@emmyoop thoughts on this refactor and how to best test it?

@ChenyuLInx ChenyuLInx marked this pull request as ready for review June 21, 2024 17:50
@ChenyuLInx ChenyuLInx requested a review from a team as a code owner June 21, 2024 17:50
@ChenyuLInx ChenyuLInx merged commit 2bae05b into main Jun 21, 2024
65 checks passed
@ChenyuLInx ChenyuLInx deleted the cl/10329 branch June 21, 2024 22:12
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.

CI check whether a unit test is introduced while code is being modified
2 participants