From 358f7f7e8c8c0d8a4a79f03a22de41927f9525a4 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Thu, 21 Nov 2024 12:10:12 -0800 Subject: [PATCH] Add some tests with a gel:// dsn --- connection_testcases.json | 72 +++++++++++++++++++++++++++++++++++++++ tests/basic/env.jsonc | 29 ++++++++++++++++ tests/basic/opts.jsonc | 12 +++++++ 3 files changed, 113 insertions(+) diff --git a/connection_testcases.json b/connection_testcases.json index f814810..87b3081 100644 --- a/connection_testcases.json +++ b/connection_testcases.json @@ -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", @@ -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" diff --git a/tests/basic/env.jsonc b/tests/basic/env.jsonc index 9e87f1e..09fbd90 100644 --- a/tests/basic/env.jsonc +++ b/tests/basic/env.jsonc @@ -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" + ] } ] diff --git a/tests/basic/opts.jsonc b/tests/basic/opts.jsonc index 629bf82..30e5e44 100644 --- a/tests/basic/opts.jsonc +++ b/tests/basic/opts.jsonc @@ -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" + } } ]