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

input csv file support on unit tests #9035

Closed
wants to merge 13 commits into from

Conversation

emmyoop
Copy link
Member

@emmyoop emmyoop commented Nov 8, 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 8, 2023
@emmyoop emmyoop changed the base branch from main to unit_testing_feature_branch November 8, 2023 15:19
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

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

Comparison is base (f629baa) 64.65% compared to head (922c1af) 83.46%.
Report is 9 commits behind head on unit_testing_feature_branch.

Additional details and impacted files
@@                       Coverage Diff                        @@
##           unit_testing_feature_branch    #9035       +/-   ##
================================================================
+ Coverage                        64.65%   83.46%   +18.80%     
================================================================
  Files                              181      182        +1     
  Lines                            26973    27098      +125     
================================================================
+ Hits                             17440    22617     +5177     
+ Misses                            9533     4481     -5052     
Flag Coverage Δ
integration 83.46% <60.17%> (?)
unit ?

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

Files Coverage Δ
core/dbt/compilation.py 95.94% <100.00%> (+37.83%) ⬆️
core/dbt/config/project.py 94.10% <100.00%> (+3.81%) ⬆️
core/dbt/context/providers.py 89.48% <100.00%> (+25.29%) ⬆️
core/dbt/contracts/files.py 94.61% <100.00%> (+18.94%) ⬆️
core/dbt/node_types.py 100.00% <100.00%> (+12.72%) ⬆️
core/dbt/parser/read_files.py 84.50% <ø> (+38.49%) ⬆️
core/dbt/context/context_config.py 93.10% <50.00%> (+13.20%) ⬆️
core/dbt/contracts/graph/model_config.py 89.80% <70.00%> (+6.38%) ⬆️
core/dbt/contracts/graph/unparsed.py 93.56% <85.00%> (+6.79%) ⬆️
core/dbt/contracts/graph/nodes.py 89.05% <63.82%> (+11.29%) ⬆️
... and 1 more

... and 133 files with indirect coverage changes

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

@emmyoop emmyoop closed this Nov 9, 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