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

failing unit test displayed in system logs, not at the node level #9619

Closed
2 tasks done
Tracked by #8283
graciegoheen opened this issue Feb 21, 2024 · 2 comments · Fixed by #9820
Closed
2 tasks done
Tracked by #8283

failing unit test displayed in system logs, not at the node level #9619

graciegoheen opened this issue Feb 21, 2024 · 2 comments · Fixed by #9820
Assignees
Labels
enhancement New feature or request Impact: Exp Impact: Orch pre-release Bug not yet in a stable release unit tests Issues related to built-in dbt unit testing functionality
Milestone

Comments

@graciegoheen
Copy link
Contributor

graciegoheen commented Feb 21, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Here’s a quick loom walking through the problem

I can see the logs for a failing unit test in the system logs, but not at the node level

Expected Behavior

  • I should be able to view the failing unit test log message at the node level
  • I should be able to view the failing data test log message at the node level
@graciegoheen graciegoheen added bug Something isn't working pre-release Bug not yet in a stable release labels Feb 21, 2024
@gshank
Copy link
Contributor

gshank commented Feb 21, 2024

This works the same way as data tests. Maybe it shouldn't, of course... The NodeFinished logging event contains the RunResult (which contains the actual error text) but the "msg" is just "Finished running node unit_test.my_dbt_unit_tests.my_model.test_my_model". After that the logging events don't have node_info, and so won't be separated out into node specific logs.

@graciegoheen graciegoheen added enhancement New feature or request Impact: Exp Impact: Orch and removed bug Something isn't working labels Feb 21, 2024
@graciegoheen graciegoheen added this to the v1.8 milestone Feb 22, 2024
@gshank
Copy link
Contributor

gshank commented Mar 22, 2024

This is actually the way it works for all erroring nodes, like models. The errors are reported at the end from RunResultError (etc) events, and this is after all the other nodes have run. So I don't think we can just add node_info to the RunResult events, it might throw off other things. At the end of each node execution, we clear out the node_info, for one thing, and the errors are reported long after. So this might not be something that can be fixed in core or in core alone.

@dbeatty10 dbeatty10 added the unit tests Issues related to built-in dbt unit testing functionality label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Impact: Exp Impact: Orch pre-release Bug not yet in a stable release unit tests Issues related to built-in dbt unit testing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants