dbt-labs / dbt-labs/dbt

[Feature] Automatically use unspecified seed as input for unit tests

Open
#11,977 2 comments 0 reactions 0 assignees View on GitHub
engine:v1 seeds status:triage type:feature unit tests
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

### 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

For a unit-test, the [docs ](https://docs.getdbt.com/reference/resource-properties/unit-test-input) suggest if you do not provide an input for a seed it will automatically use the seed as input. However, I find this to not be the case.

For example::
```
unit_tests:
- name: test_some_functionality
model: some_model_which_references_a_seed
expect:
rows:
- {some_value: 1}

```

This unit test throws an error "depends on a node named 'some_seed_file' which was not found.

Confirmed dbt can find the seed (`dbt ls --resource-type seed -s some_seed_file`) and the model builds.

However, this works:

```
unit_tests:
- name: test_some_functionality
model: some_model_which_references_a_seed
input: ref('some_seed_file')
expect:
rows:
- {some_value: 1}

```

### Expected Behavior

[Given the docs, I](https://docs.getdbt.com/reference/resource-properties/unit-test-input) expect the seed file to be automatically picked up.

### Steps To Reproduce

Run a unit test for a model which depends on a seed file, but do not provide any information as input to the seed.

### Relevant log output

```shell

```

### Environment

```markdown
- OS: macOS
- Python: 3.10.9
- dbt: 1.10.10
```

### Which database adapter are you using with dbt?

Snowflake

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.