-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: unit tests with versioned refs #10889
fix: unit tests with versioned refs #10889
Conversation
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. |
1 similar comment
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10889 +/- ##
===========================================
- Coverage 89.10% 62.78% -26.33%
===========================================
Files 183 183
Lines 23626 23630 +4
===========================================
- Hits 21051 14835 -6216
- Misses 2575 8795 +6220
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hello @dbeatty10. This is a PR with a very simple fix that closes 3 open issues. It's covered by functional tests, but I’m not sure why this class doesn’t have any unit tests, so I left that aside. |
Thank you for the contribution @devmessias! This is looking good overall, but it looks like this PR is failing on unrelated functional tests with the same 'strategy' error for tests related to snapshots. We've been doing a lot of work on snapshots recently so it may just be an intermittent issue that has since been resolved. Could you please merge Otherwise, just a refactoring suggestion for clarity, as well as some examples of testing for expected errors in logs. |
missing latest prop
deleted before due a mistake
0afd0d9
to
f155805
Compare
Hi @MichelleArk , the branch is now updated |
8583379
to
82b2056
Compare
Resolves #10880; Resolves #10528; Resolves #10623
Problem
The error raises due the method
RefableLookup.find
at dbt-my/core/dbt/contracts/graph/manifest.py:Tracking the storage object, without specifying a version in the model we will obtain something like that for the Unit Test Node running phase
Which it seems to me that is not right, because if I specified the
latest_version
for my model, I should get a Storage like thisI run some different cases and obtain the following table
However, even in cases where the tests were successful, the storage objects it seems that not properly constructed. For example, when using
ref('upstream_model_versioned', v=1)
I got this:This worked not because the storage structure was correct, but because there was a key named
upstream_model_versioned.v1
.Solution
The only problem that I found is that the Node object for the UnitTest was not copying the value from latest_version prop if it was available
Checklist