Skip to content

feat: Extend the package with unit test coverage functionality#87

Closed
TStanovcak wants to merge 5 commits intoslidoapp:mainfrom
TStanovcak:main
Closed

feat: Extend the package with unit test coverage functionality#87
TStanovcak wants to merge 5 commits intoslidoapp:mainfrom
TStanovcak:main

Conversation

@TStanovcak
Copy link

This PR introduces support for generating coverage reports for dbt unit tests using the dbt-coverage package. Until now, dbt-coverage focused exclusively on (data) test coverage. With this enhancement, users can also analyze coverage for dbt unit tests.

The approach should conform the original architecture by adding unit_test option to compute command.

Here's the example of the output:

Coverage report (unit_test)                                                                                                                                                                                                                                                                                                                                                                     
======================================================================                                                                                                                                                                                                                                                                                                                                     
model_name_1                                           0 tests    0.0%                                                                                                                                                                                                                                                                                                                                     
model_name_2                                           8 tests  100.0%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
======================================================================                                                                                                                                                                                                                                                                                                                                     
Total                                                  8 tests   50.0%  

As model can have more then 1 unit test, report is showing the count of the tests. If there's any, it translates into full percentage coverage.

@sweco
Copy link
Collaborator

sweco commented Oct 15, 2025

Hey @TStanovcak, apologies for a later reply. Thank you for the contribution, this is a nice addition to the package. I amended a few things and would like to update your PR and merge it. However, I can't seem to be able to push to your branch.

Can you please check that you fulfil the criteria mentioned here? Most commonly the Allow edits from maintainers is disabled on the PR (docs).

@sweco
Copy link
Collaborator

sweco commented Oct 20, 2025

Thanks @TStanovcak, I moved the changes to #93 and merged it.

@sweco sweco closed this Oct 20, 2025
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.

2 participants