From 4dee5add3c0a75e72f39d0c53633c39b39141691 Mon Sep 17 00:00:00 2001 From: fmoor Date: Fri, 3 Jan 2025 15:44:26 -0700 Subject: [PATCH] Add user & password envvar tests --- README.md | 4 ++-- tests/basic/env.jsonc | 56 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a30509..49ca719 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/tests/basic/env.jsonc b/tests/basic/env.jsonc index 66ee9ad..1ff8a68 100644 --- a/tests/basic/env.jsonc +++ b/tests/basic/env.jsonc @@ -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",