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

Hardcode dbt version for project fixture in repository unit tests #10059

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

QMalcolm
Copy link
Contributor

resolves #10056

Problem

Letting the dbt version be dynamic in the project fixture previously was causing some tests to break whenever the version of dbt actually got updated, which isn't great. It'd be super annoying to have to always update tests affected by this. To get around this we've gone and hard coded the dbt version in the profile. The alternative was to interpolate the version during comparison during the relevant tests, which felt less appealing.

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

Letting the dbt version be dynamic in the project fixture previously was
causing some tests to break whenever the version of dbt actually got updated,
which isn't great. It'd be super annoying to have to always update tests
affected by this. To get around this we've gone and hard coded the dbt version
in the profile. The alternative was to interpolate the version during comparison
during the relevant tests, which felt less appealing.
@QMalcolm QMalcolm added the Skip Changelog Skips GHA to check for changelog file label Apr 27, 2024
@QMalcolm QMalcolm requested a review from a team as a code owner April 27, 2024 04:29
@cla-bot cla-bot bot added the cla:yes label Apr 27, 2024
Copy link

codecov bot commented Apr 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.19%. Comparing base (f6b2cb7) to head (e43b624).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10059      +/-   ##
==========================================
- Coverage   88.20%   88.19%   -0.01%     
==========================================
  Files         181      181              
  Lines       22665    22665              
==========================================
- Hits        19991    19989       -2     
- Misses       2674     2676       +2     
Flag Coverage Δ
integration 85.57% <ø> (+<0.01%) ⬆️
unit 62.31% <ø> (ø)

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

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

@peterallenwebb peterallenwebb merged commit 4e1b44e into main Apr 29, 2024
61 of 62 checks passed
@peterallenwebb peterallenwebb deleted the qmalcolm--10056-fix-project-unit-testing branch April 29, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit tests for Project class break due to hardcoded assertion on changing version value
2 participants