Skip to content

Commit

Permalink
Add some tests with a gel:// dsn (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
msullivan authored Nov 21, 2024
1 parent 6b032a6 commit e395996
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
72 changes: 72 additions & 0 deletions connection_testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,56 @@
"waitUntilAvailable": "PT30S"
}
},
{
"env": {
"EDGEDB_CLIENT_SECURITY": "strict",
"EDGEDB_CLIENT_TLS_SECURITY": "strict",
"EDGEDB_DSN": "gel://"
},
"name": "basic_env_test_gel_01",
"result": {
"address": [
"localhost",
5656
],
"branch": "__default__",
"database": "edgedb",
"password": null,
"secretKey": null,
"serverSettings": {},
"tlsCAData": null,
"tlsSecurity": "strict",
"tlsServerName": null,
"user": "edgedb",
"waitUntilAvailable": "PT30S"
}
},
{
"env": {
"EDGEDB_DSN": "gel://user3:123123@localhost:5555/abcdef",
"EDGEDB_PORT": "tcp://localhost:123"
},
"name": "basic_env_test_gel_02",
"result": {
"address": [
"localhost",
5555
],
"branch": "abcdef",
"database": "abcdef",
"password": "123123",
"secretKey": null,
"serverSettings": {},
"tlsCAData": null,
"tlsSecurity": "strict",
"tlsServerName": null,
"user": "user3",
"waitUntilAvailable": "PT30S"
},
"warnings": [
"docker_tcp_port"
]
},
{
"fs": {
"cwd": "/home/edgedb/test",
Expand Down Expand Up @@ -1964,6 +2014,28 @@
"waitUntilAvailable": "PT30S"
}
},
{
"name": "basic_opts_test_gel_dsn_1",
"opts": {
"dsn": "gel://testuser@localhost/db?password=not_secret_password"
},
"result": {
"address": [
"localhost",
5656
],
"branch": "db",
"database": "db",
"password": "not_secret_password",
"secretKey": null,
"serverSettings": {},
"tlsCAData": null,
"tlsSecurity": "strict",
"tlsServerName": null,
"user": "testuser",
"waitUntilAvailable": "PT30S"
}
},
{
"error": {
"type": "credentials_file_not_found"
Expand Down
29 changes: 29 additions & 0 deletions tests/basic/env.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -389,5 +389,34 @@
},
"name": "test_31",
"result": {}
},
{
"env": {
"EDGEDB_CLIENT_SECURITY": "strict",
"EDGEDB_CLIENT_TLS_SECURITY": "strict",
"EDGEDB_DSN": "gel://"
},
"name": "test_gel_01",
"result": {}
},
{
"env": {
"EDGEDB_DSN": "gel://user3:123123@localhost:5555/abcdef",
"EDGEDB_PORT": "tcp://localhost:123"
},
"name": "test_gel_02",
"result": {
"address": [
"localhost",
5555
],
"branch": "abcdef",
"database": "abcdef",
"password": "123123",
"user": "user3"
},
"warnings": [
"docker_tcp_port"
]
}
]
12 changes: 12 additions & 0 deletions tests/basic/opts.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,17 @@
"c": "ghi"
}
}
},
{
"name": "test_gel_dsn_1",
"opts": {
"dsn": "gel://testuser@localhost/db?password=not_secret_password"
},
"result": {
"branch": "db",
"database": "db",
"password": "not_secret_password",
"user": "testuser"
}
}
]

0 comments on commit e395996

Please sign in to comment.