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

Fix --resource-type test for dbt list and dbt build #10730

Merged
merged 5 commits into from
Sep 18, 2024
Merged

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Sep 17, 2024

Resolves #10727

Problem

This command includes both data tests and unit tests (when it should only include data tests):

dbt list --resource-type test

So does this:

dbt build --resource-type test

Solution

Add a resource_types parameter to the constructor for the TestSelector class. Give it a default value of [NodeType.Test, NodeType.Unit]. Override the default parameter as-needed.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.).
  • This PR includes type annotations for new and modified functions.

@dbeatty10 dbeatty10 added the Skip Changelog Skips GHA to check for changelog file label Sep 17, 2024
@cla-bot cla-bot bot added the cla:yes label Sep 17, 2024
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.90%. Comparing base (c6b8f7e) to head (d07d557).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10730   +/-   ##
=======================================
  Coverage   88.90%   88.90%           
=======================================
  Files         180      180           
  Lines       22856    22856           
=======================================
+ Hits        20319    20320    +1     
+ Misses       2537     2536    -1     
Flag Coverage Δ
integration 86.10% <100.00%> (+<0.01%) ⬆️
unit 62.42% <100.00%> (ø)

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

Components Coverage Δ
Unit Tests 62.42% <100.00%> (ø)
Integration Tests 86.10% <100.00%> (+<0.01%) ⬆️

@dbeatty10 dbeatty10 changed the title Fix dbt list --resource-type test Fix --resource-type test for dbt list and dbt build Sep 17, 2024
@dbeatty10 dbeatty10 removed the Skip Changelog Skips GHA to check for changelog file label Sep 17, 2024
@dbeatty10 dbeatty10 marked this pull request as ready for review September 18, 2024 01:04
@dbeatty10 dbeatty10 requested a review from a team as a code owner September 18, 2024 01:04
@dbeatty10 dbeatty10 requested a review from gshank September 18, 2024 15:51
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.

[Bug] --resource-type test includes both data tests and unit tests
2 participants