[CT-2971] Write a test for connection failures in `dbt debug`
- Dominant language
- Rust
- Stars
- 13.8k
- Forks
- 2.6k
- Avg merge
- 21h 31m
- Merged PRs (30d)
- 56
Description
### Housekeeping
- [X] I am a maintainer of dbt-core
### Short description
Connection statuses were added to the list of failure statuses in https://github.com/dbt-labs/dbt-core/pull/8351, fixing the bug where `dbt debug` returned success (0 exit code) when the connection test failed.
However, this PR didn't contain a test for connection failures; the goal of this ticket is to create this test.
### Acceptance Criteria
- Codecov should not complain that this line doesn't have test coverage:
https://github.com/dbt-labs/dbt-core/pull/8351/files#diff-e6b4d7d3e818b6a57ae7a17ffe1b07a56e4b0b83ed0798a4f41a1beecfda9804R152
- When there is an invalid password, `dbt debug` should return a non-zero exit status
- There should be tests for invalid:
- host
- port
- dbname
- user
- pass
- Across all platforms (Windows, macOS, and Linux), an invalid password should have an understandable error message that describes what the problem is
- e.g., `FATAL: password authentication failed for user` in the log output (see [#9297](https://github.com/dbt-labs/dbt-core/issues/9297))
- see "Additional details" below
### Additional details
See https://github.com/dbt-labs/dbt-core/issues/9297#issuecomment-1872984587 for more details on the desired error message.
**TLDR**: there is currently a confusing error message for failed authentication in Windows:
```
utf-8' codec can't decode byte 0xe9 in position 103: invalid continuation byte
```
### Impact to Other Teams
N/A
### Will backports be required?
No
Contributor guide
Assessment
This issue has not been assessed yet.