# post hook configured for tests in dbt\_project.yml?

**URL:** <https://discourse.getdbt.com/t/post-hook-configured-for-tests-in-dbt-project-yml/19411>\
**Category:** Help\
**Created:** [May 15, 2025, 1:19pm UTC](https://discourse.getdbt.com/t/post-hook-configured-for-tests-in-dbt-project-yml/19411 "2025-05-15T13:19:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmollin](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cmollin](https://discourse.getdbt.com/u/cmollin)\
**Post date:** [May 15, 2025, 1:19pm UTC](https://discourse.getdbt.com/t/post-hook-configured-for-tests-in-dbt-project-yml/19411/1 "2025-05-15T13:19:17Z")

</div>

## The problem I’m having

Create a table using SQL to capture credits used on each unique test run as well as other pertinent information — warehouse, etc. Similar to using a post hook on “models” in dbt\_project.yml then being able to parse information on each test of each model.

## The context of why I’m trying to do this

I’ve tried run\_results.json but this is not returning enough information relative to what a post hook on a model run returns.

## What I’ve already tried

See above, for loop on run\_results node structure has worked but is slow and is not returning the information I need. Inserted a macro on on-run-end to be able to access run results

## Some example code or error messages

For models, in dbt\_project.yml, e.g.:

```auto
models: 
      base: 
          post_hook: "{{ example_macro( ) }}" 

```

Is this same functionality supported for tests? It wasn’t working initially for me:

```auto
tests: 
      base: 
          post_hook: "{{ example_macro( ) }}" 

```
