-
Notifications
You must be signed in to change notification settings - Fork 79
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
In 0.4.0, dbt test
succeeds but dbt build
fails
#197
Comments
Hi @davenettle, you're right, there is an issue with the build command with v0.4.0. Please check v0.4.1, it should fix the issue. Thank you very much for your report 👍 🙂 |
Thanks for the commit. I tried it out but unfortunately I noticed something else. When I purposely fail the test, Test (note different order_id in the expect()): {{ config(tags=['unit-test']) }}
{% call dbt_unit_testing.test ('orders',
'it should do something with orders') %}
{% call dbt_unit_testing.mock_ref ('seed_orders') %}
select
2 as order_id
, 2 as customer_id
, '2024-01-01'::date as order_date
, 'completed' as status
{% endcall %}
{% call dbt_unit_testing.expect() %}
select
1 as order_id /* <-- different order id */
, 2 as customer_id
, '2024-01-01'::date as order_date
, 'completed' as status
{% endcall %}
{% endcall %} Results in 0.3.4dbt test
dbt build
Results in 0.4.1dbt testSame as 0.3.4 dbt test dbt build
|
Hi @davenettle, sorry about that. Please try v0.4.11, I hope it fixes your issue. Thanks again for the report 👍 |
Thanks @psousa50, that seems to have fixed it! |
Noticed this in our production build when we tried updating to 0.4.0. We had some fairly simple tests that did a couple of mocks and an expect, and we noticed in CI that while
dbt test
worked,dbt build
would fail. So I've tried to replicate the issue by wrangling/simplifying the typical jaffle_shop example.The files look like:
Prepare to run:
dbt clean
dbt deps
Run results in 0.4.0:
Change back to 0.3.4
Update packages.yml to use 0.3.4 and then
dbt clean
anddbt deps
again.build in 0.3.4
Notes
After a bit of digging we noticed that the file
target/run/jaffle_shop/tests/orders_test.sql
looked like this in 0.3.4:... but like this in 0.4.0:
... which seems to be the reason that the error is showing up as a syntax error.
Thanks for the package, hopefully this is just a simple case of me holding it wrong 😭
The text was updated successfully, but these errors were encountered: