-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure url encoded characters are handled correctly #10
base: main
Are you sure you want to change the base?
Conversation
51d7d77
to
b5a3437
Compare
@@ -42,3 +42,44 @@ func TestMarshall(t *testing.T) { | |||
t.Fail() | |||
} | |||
} | |||
|
|||
func TestCheckPostgres(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by the test results in the job output. All of the tests seem to produce errors but the tests pass.
=== RUN TestCheckPostgres
09:29:11.664948 0 attempt: can't parse Postgres DSN: cannot parse `***localhost:5432/db`: failed to parse as DSN (invalid dsn)
--- PASS: TestCheckPostgres (0.00s)
=== RUN TestCheckSnowflake
09:29:11.665012 0 attempt: can't parse Snowflake DSN: 260002: password is empty
--- PASS: TestCheckSnowflake (0.00s)
=== RUN TestCheckDatabricks
09:29:11.665112 0 attempt: can't open a connection to databricks: scheme db not recognized
--- PASS: TestCheckDatabricks (0.00s)
=== RUN TestCheckUnknownDriver
09:29:11.665152 0 attempt: unknown driver: unknown
--- PASS: TestCheckUnknownDriver (0.00s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing that's because the tests are expecting to fail, so the failure messages get returned when performing the check? The tests fail if the result doesn't contain those errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much what @ungn said, those unit tests ensure invalid DSNs are handled correctly. There is 1 integration tests which ensures Check
works with Postgres (happy path)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for confirming ! Always seems wrong with just negative tests but we can't do positive tests for Databricks/Snowflake/Redshift.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
xo/dburl
work with url encoded characters so decided to drop it entirely and use drivers directlyxo/dburl
and can use drivers docs directlyExample usage