Repository: dbt-labs/dbt-core (Python)

Issue:
[Bug] generic tests to accept arbitrary configs does not appear to be pulling in config options for certain tests
### Is this a new bug in dbt-core?

- [X] I believe this is a new bug in dbt-core
- [X] I have searched the existing issues, and I could not find an existing issue for this bug

### Current Behavior

while trying respond to a slack conversation [thread](https://dbt-labs.slack.com/archives/C017GDLAF7D/p1721696763124499)

about implementing the new general config options for `data_tests`

found that local testing showed that some tests types are not accepting the `config` object it seems 
```
version: 2
models:
  - name: my_test_model  # Replace with your actual model name
    columns:
      - name: id
        data_tests:
          - not_null:
              config:
                snowflake_warehouse: analytics
```

logs test may pass but logs will not show `snowflake_warehouse` being set

best guess is tests that just trigger a macro without having any real additional config are for some reason now not able to pull in the general config.

### Expected Behavior

all test types should be able to have config options added based on the work done around https://github.com/dbt-labs/dbt-core/issues/10197

### Steps To Reproduce

create various simple models to test against

schema.yml

```
version: 2
models:
  - name: my_test_model # Replace with your actual model name
    columns:
      - name: color
        tests:
          - accepted_values:
              values: ['blue', 'red', 'green', 'yellow']
              config:
                snowflake_warehouse: analytics

# can sub out for a not_null test to match above

 - name: my_test_model  # Replace with your actual model name
    columns:
      - name: id
        data_tests:
          - not_null:
              config:
                snowflake_warehouse: analytics
            

  - name: child_table
    description: "Child table containing records referencing the parent table"
    columns:
      - name: parent_id
        data_tests:
          - relationships:
              to: ref('parent_table')
              field: id
              config:
                snowflake_warehouse: dbt_snowflake_warehouse
```

models
```
child_table.sql
select * from {{ ref('child') }}

parent_table.sql
select * from {{ ref('parent') }}

my_test_model.sql
select * from {{ ref('seed') }}
```
seeds
```
child.csv

id,parent_id,value
1,1,Value 1
2,1,Value 2
3,2,Value 3
4,3,Value 4  # Corrected parent_id to 3 which exists in parent_table

parent.csv

id,name
1,Parent A
2,Parent B
3,Parent C

seed.csv

id,color,value
1,blue,10
2,red,20
3,green,30
4,yellow,40
5,blue,50
6,red,60
7,blue,70
8,green,80
9,yellow,90
10,blue,100
```

### Relevant log output

_No response_

### Environment

```markdown
- OS:
- Python:
- dbt:
```


### Which database adapter are you using with dbt?

_No response_

### Additional Context

_No response_



Fix (patch):
diff --git a/.changes/unreleased/Fixes-20240925-154514.yaml b/.changes/unreleased/Fixes-20240925-154514.yaml
new file mode 100644
index 00000000000..8db05cc6a0e
--- /dev/null
+++ b/.changes/unreleased/Fixes-20240925-154514.yaml
@@ -0,0 +1,6 @@
+kind: Fixes
+body: Pass test user config to adapter pre_hook by explicitly adding test builder config to node
+time: 2024-09-25T15:45:14.459598-07:00
+custom:
+  Author: colin-rogers-dbt
+  Issue: "10484"
diff --git a/core/dbt/context/context_config.py b/core/dbt/context/context_config.py
index a5b38bb415e..b1aace475c7 100644
--- a/core/dbt/context/context_config.py
+++ b/core/dbt/context/context_config.py
@@ -6,10 +6,12 @@
 from dbt.adapters.factory import get_config_class_by_name
 from dbt.config import IsFQNResource, Project, RuntimeConfig
 from dbt.contracts.graph.model_config import get_config_for
+from dbt.exceptions import SchemaConfigError
 from dbt.flags import get_flags
 from dbt.node_types import NodeType
 from dbt.utils import fqn_search
 from dbt_common.contracts.config.base import BaseConfig, merge_config_dicts
+from dbt_common.dataclass_schema import ValidationError
 from dbt_common.exceptions import DbtInternalError
 
 
@@ -237,8 +239,12 @@ def calculate_node_config_dict(
             base=base,
             patch_config_dict=patch_config_dict,
         )
-        finalized = config.finalize_and_validate()
-        return finalized.to_dict(omit_none=True)
+        try:
+            finalized = config.finalize_and_validate()
+            return finalized.to_dict(omit_none=True)
+        except ValidationError as exc:
+            # we got a ValidationError - probably bad types in config()
+            raise SchemaConfigError(exc, node=config) from exc
 
 
 class UnrenderedConfigGenerator(BaseContextConfigGenerator[Dict[str, Any]]):