Skip to content

Conversation

@MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Dec 3, 2025

Resolves #10540

Problem

If a unit test is testing a model that is disabled, selecting it ends up in either compilation or parsing errors

Solution

If a tested model is disabled, disable the unit tests for that model as well. Even if the unit test is manually set to enabled: true via its own config - it should still be disabled because otherwise we'd run into graph dependency parse/compile errors as reported!

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, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Dec 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.91%. Comparing base (bbd8fa0) to head (8431e42).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12251      +/-   ##
==========================================
- Coverage   91.98%   90.91%   -1.07%     
==========================================
  Files         203      203              
  Lines       24981    24993      +12     
==========================================
- Hits        22979    22723     -256     
- Misses       2002     2270     +268     
Flag Coverage Δ
integration 87.57% <50.00%> (-1.37%) ⬇️
unit 65.29% <50.00%> (-0.02%) ⬇️

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

Components Coverage Δ
Unit Tests 65.29% <50.00%> (-0.02%) ⬇️
Integration Tests 87.57% <50.00%> (-1.37%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MichelleArk MichelleArk added the user docs [docs.getdbt.com] Needs better documentation label Dec 5, 2025
@MichelleArk MichelleArk marked this pull request as ready for review December 5, 2025 22:49
@MichelleArk MichelleArk requested a review from a team as a code owner December 5, 2025 22:49
@MichelleArk MichelleArk force-pushed the disable-unit-test-if-model-disabled branch from 01cfeac to b7a410c Compare December 6, 2025 00:24
@MichelleArk MichelleArk force-pushed the disable-unit-test-if-model-disabled branch from b7a410c to 8ded115 Compare December 6, 2025 00:43
@MichelleArk MichelleArk force-pushed the disable-unit-test-if-model-disabled branch from 7e9c594 to 8431e42 Compare December 6, 2025 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes user docs [docs.getdbt.com] Needs better documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Disable unit tests whose model is disabled

2 participants