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

ignore --empty in unit test ref/source calls #10764

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Sep 23, 2024

Resolves #10516

Problem

The unit test ref and source resolvers inherit from the base resolvers, meaning they were getting --empty limit filters applied when used with the --empty flag. This causes tests to fail / behave unpredictably since the mocked data is no longer used to configure the unit test!

Solution

overwrite resolve_limit in unit test ref/source resolvers directly to always return None (no limit filter applied), as they are never needed in the unit testing context.

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 Sep 23, 2024
Copy link
Contributor

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.

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.95%. Comparing base (db69473) to head (9f2316c).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10764      +/-   ##
==========================================
- Coverage   88.97%   88.95%   -0.02%     
==========================================
  Files         181      181              
  Lines       22956    22983      +27     
==========================================
+ Hits        20424    20445      +21     
- Misses       2532     2538       +6     
Flag Coverage Δ
integration 86.13% <83.33%> (-0.01%) ⬇️
unit 62.39% <66.66%> (-0.06%) ⬇️

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

Components Coverage Δ
Unit Tests 62.39% <66.66%> (-0.06%) ⬇️
Integration Tests 86.13% <83.33%> (-0.01%) ⬇️

@MichelleArk MichelleArk marked this pull request as ready for review September 23, 2024 22:12
@MichelleArk MichelleArk requested a review from a team as a code owner September 23, 2024 22:12
@MichelleArk MichelleArk merged commit aa23af9 into main Sep 23, 2024
67 of 68 checks passed
@MichelleArk MichelleArk deleted the ignore-empty-in-unit-tests branch September 23, 2024 22:36
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] dbt build with --empty flag compiles unit tests with empty mock fixtures
2 participants