Skip to content
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

Add user & password envvar tests #43

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Environment variables present at the time of connecting. Possible values:
| -------------------------- | --------------------------------------------------- |
| `GEL_HOST` | same as `host` above |
| `GEL_PORT` | same as `port` above |
| `EDGEDB_USER` | same as `user` above |
| `EDGEDB_PASSWORD` | same as `password` above |
| `GEL_USER` | same as `user` above |
| `GEL_PASSWORD` | same as `password` above |
| `EDGEDB_SECRET_KEY` | same as `secretKey` above |
| `EDGEDB_DATABASE` | same as `database` above |
| `GEL_BRANCH` | same as `branch` above |
Expand Down
92 changes: 92 additions & 0 deletions connection_testcases.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,98 @@
[
{
" ": "/*** WARNING: do not edit this file. This is automatically rebuilt using tools/rebuild.ts ***/",
"env": {
"EDGEDB_PASSWORD": "secret",
"EDGEDB_PORT": "1234"
},
"name": "basic_env_EDGEDB_PASSWORD is recognised",
"result": {
"address": [
"localhost",
1234
],
"branch": "__default__",
"database": "edgedb",
"password": "secret",
"secretKey": null,
"serverSettings": {},
"tlsCAData": null,
"tlsSecurity": "strict",
"tlsServerName": null,
"user": "edgedb",
"waitUntilAvailable": "PT30S"
}
},
{
"env": {
"EDGEDB_PORT": "1234",
"EDGEDB_USER": "testuser"
},
"name": "basic_env_EDGEDB_USER is recognised",
"result": {
"address": [
"localhost",
1234
],
"branch": "__default__",
"database": "edgedb",
"password": null,
"secretKey": null,
"serverSettings": {},
"tlsCAData": null,
"tlsSecurity": "strict",
"tlsServerName": null,
"user": "testuser",
"waitUntilAvailable": "PT30S"
}
},
{
"env": {
"GEL_PASSWORD": "secret",
"GEL_PORT": "1234"
},
"name": "basic_env_GEL_PASSWORD is recognised",
"result": {
"address": [
"localhost",
1234
],
"branch": "__default__",
"database": "edgedb",
"password": "secret",
"secretKey": null,
"serverSettings": {},
"tlsCAData": null,
"tlsSecurity": "strict",
"tlsServerName": null,
"user": "edgedb",
"waitUntilAvailable": "PT30S"
}
},
{
"env": {
"GEL_PORT": "1234",
"GEL_USER": "testuser"
},
"name": "basic_env_GEL_USER is recognised",
"result": {
"address": [
"localhost",
1234
],
"branch": "__default__",
"database": "edgedb",
"password": null,
"secretKey": null,
"serverSettings": {},
"tlsCAData": null,
"tlsSecurity": "strict",
"tlsServerName": null,
"user": "testuser",
"waitUntilAvailable": "PT30S"
}
},
{
"env": {
"EDGEDB_PORT": "1234"
},
Expand Down
56 changes: 56 additions & 0 deletions tests/basic/env.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,62 @@
]
}
},
{
"name": "EDGEDB_USER is recognised",
"env": {
"EDGEDB_PORT": "1234",
"EDGEDB_USER": "testuser"
},
"result": {
"address": [
"localhost",
1234
],
"user": "testuser"
}
},
{
"name": "GEL_USER is recognised",
"env": {
"GEL_PORT": "1234",
"GEL_USER": "testuser"
},
"result": {
"address": [
"localhost",
1234
],
"user": "testuser"
}
},
{
"name": "EDGEDB_PASSWORD is recognised",
"env": {
"EDGEDB_PORT": "1234",
"EDGEDB_PASSWORD": "secret"
},
"result": {
"address": [
"localhost",
1234
],
"password": "secret"
}
},
{
"name": "GEL_PASSWORD is recognised",
"env": {
"GEL_PORT": "1234",
"GEL_PASSWORD": "secret"
},
"result": {
"address": [
"localhost",
1234
],
"password": "secret"
}
},
{
"env": {
"EDGEDB_DSN": "edgedb://user3:123123@localhost:5555/abcdef",
Expand Down
Loading