# How to do folder based testing ?

**URL:** <https://discourse.getdbt.com/t/how-to-do-folder-based-testing/17228>\
**Category:** Help\
**Tags:** testing, dbt-core\
**Created:** [December 5, 2024, 2:05pm UTC](https://discourse.getdbt.com/t/how-to-do-folder-based-testing/17228 "2024-12-05T14:05:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yvpierre](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/yvpierre/32/4968_2.png) [@yvpierre](https://discourse.getdbt.com/u/yvpierre)\
**Post date:** [December 5, 2024, 2:05pm UTC](https://discourse.getdbt.com/t/how-to-do-folder-based-testing/17228/1 "2024-12-05T14:05:36Z")

</div>

## The problem I’m having

I cannot test several models at once and I need to access the name of the model being tested as I am calling a generic test

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

(All the code snippets are from my schema.yml)  
Working on a numerous amount of models, I want to group tests and ideally have something like:

```auto
version: 2
models:
  - name: '*'
    tests:
      - condition_ratio:
          source_table: "{{ get_source_table('*.name') }}"

```

(Obviously the above code is ridiculous but it is there to explain the end idea).

## What I’ve already tried

- Using the ‘group’ tag and applying it to my schema.yml scoped file among my other tests.
- Using the "-name: ‘\*’ " model to try to “apply to all” models including these in sub-folders.

## Some example code or error messages

The following code

```auto
version: 2

models:
  - name: '*'
    tests:
      - my_condition:
          source_table: "{{ get_source('model.name') }}"

```

Gives me

```auto
'test.proj.condition_macro.modelname' (path\to\schema.yml) depends on a node named '*' in package ' ' which was not found
Encountered an error:
Parsing Error in model my_model1 (path\to\my_model1.sql)
  Invalid group 'published', expected one of []

```
