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

support csv file fixtures for unit tests #9014

Closed
wants to merge 11 commits into from

Conversation

emmyoop
Copy link
Member

@emmyoop emmyoop commented Nov 6, 2023

resolves #8290

Problem

No support for csv files in unit testing.

Solution

Support a csv file in addition to an inline csv definition.

  - name: test_my_model_empty
    model: my_model
    given:
      - input: ref('my_model_a')
        format: csv
        fixture: test_my_model_a_empty_fixture_csv
      - input: ref('my_model_b')
        format: csv
        fixture: test_my_model_fixture

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/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 Nov 6, 2023
Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (f629baa) 64.65% compared to head (e8aade6) 85.42%.

Additional details and impacted files
@@                       Coverage Diff                        @@
##           unit_testing_feature_branch    #9014       +/-   ##
================================================================
+ Coverage                        64.65%   85.42%   +20.76%     
================================================================
  Files                              181      181               
  Lines                            26973    26984       +11     
================================================================
+ Hits                             17440    23051     +5611     
+ Misses                            9533     3933     -5600     
Flag Coverage Δ
integration 82.11% <85.71%> (?)
unit 64.63% <28.57%> (-0.02%) ⬇️

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

Files Coverage Δ
core/dbt/contracts/graph/unparsed.py 93.94% <85.71%> (+7.17%) ⬆️

... and 117 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@emmyoop emmyoop changed the base branch from main to unit_testing_feature_branch November 7, 2023 01:48
@emmyoop emmyoop marked this pull request as ready for review November 7, 2023 02:27
@emmyoop emmyoop requested a review from a team as a code owner November 7, 2023 02:27
@emmyoop emmyoop requested a review from aranke November 7, 2023 02:27
@emmyoop emmyoop marked this pull request as draft November 7, 2023 02:57
@emmyoop emmyoop closed this Nov 8, 2023
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.

[CT-2917] Add ability to use csv file fixtures for inputs/expected in addition to inline yaml dict/csv
1 participant