dbt-labs / dbt-labs/dbt

[CT-1018] [Bug] grants testing requires a user-supplied `test.env`

Open
#5,632 1 comment 0 reactions 0 assignees View on GitHub
area:cicd engine:v1 type:tech-debt
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

The grants tests in `tests/adapter/dbt/tests/adapter/grants/` require a `test.env` file. This is less than ideal as it breaks test targets in the makefile and doesn't give any sort of warning or instruction when this occurs.

I believe we can effect the same changes without the need for a `.env` file by using the pytest [monkeypatch.setenv](https://docs.pytest.org/en/7.1.x/how-to/monkeypatch.html#monkeypatching-environment-variables) feature.

### Expected Behavior

Test should run without any setup beyond what's supplied in `make dev` & `make setup-db`

### Steps To Reproduce

run `make integration` (or any make target that includes `tests/adapters` without a test.env file

### Relevant log output

_No response_

### Environment

```markdown
- OS:
- Python:
- dbt:
```

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

_No response_

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