Running macros at on-run-end

I’d like to access the full name of a failed test at the target database on on-run-end. I figured I’d use the ‘model’ part of a result object to do this, but it’s a string like this:

`‘model’: “{{ get_where_subquery(ref(‘rawinvoice_dim_analytics’)) }}”``

and when I try to for example log it, it doesn’t resolve to its target name since macros aren’t resolved at runtime (?). Is there a way to resolve it to its full target name?

I want to do this because I’d like to add Snowflake constraints even if the test failed (wouldn’t use the rely keyword). The reason I want to add them is so our customer can use them to create an ER diagram with a third party tool