# ask-community

Emir Karamehmetoglu

03/21/2023, 4:31 PM
In dagster-dbt, the following lines skip adding tests as dagster assets. would be great to make that optional, so I can see my tests as assets with proper linking. Has anyone managed to put dbt tests as assets into dagster?
I hope it’s allowed to tag you @owen as you had corresponded regarding dbt tests before. ( The issue I have is different, I think it would be really nice to represent tests as downstream assets as well. Because they are. I often want to react to the output of a test in someway and I am interested in it. So I want my dbt tests as dependent assets on the dbt models they test. Any hints you can give me? I am trying to hack it together in dagster-dbt and rebuild


03/21/2023, 4:44 PM
hi @Emir Karamehmetoglu! at the moment, this would indeed require a fair bit of hacking, as there is no hook for modifying this behavior. I think you'd have to start with updating this line to include tests as an asset resource type: The biggest lift would be updating this function: to make sure you get the correct event type for tests (right now, it emits AssetObservations, but you'd need to emit outputs). This definitely isn't supported behavior so you might run into other roadblocks along the way, but that's where I would start approaching this

Emir Karamehmetoglu

03/21/2023, 5:10 PM
Thank you so much! At least I have a place to get started!
Hi @owen, I got this working in a few ways, but wanted your advice on how to handle the tests as assets when construction via AssetsSelection: Should: • test assets be in the same
? ◦ and use
command, and keep the same
? ◦ use a new
for the NodeDefinition of the AssetsSelection that chooses
based on the asset resource type. • Or be in a second
that only contains tests (and obviously their upstreams/downstreams) so that they can be independently triggered? I guess using
dbt test
command. This is a question of "what is ideal?" Maybe one or the other is an easier approach, not sure.