From 7f39da0b570af5929c0985fc9ca92af661defd6e Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sun, 17 Nov 2024 11:37:24 -0700 Subject: [PATCH] add test of domain_socket support (#94) * add test of domain_socket support * update changelog --- CHANGELOG.md | 16 ++++++++++++---- config/example.config | 3 ++- config/sys.config | 6 ++++++ docker-compose.yml | 2 ++ test/pgo_basic_SUITE.erl | 26 +++++++++++++++++++------- 5 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 config/sys.config diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eca322..38c9389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ ### Added +- Support unix domain socket host names + [#90](https://github.com/erleans/pgo/pull/90) + +### Fixed + +- Fix `pgo_handler:decode_tag` return value + [#64][https://github.com/erleans/pgo/pull/64] + +## [v0.13.0 - Oct 13, 2022] + +### Added + - SCRAM support -- Thanks to https://github.com/epgsql/epgsql/ - OpenTelemetry replaces OpenCensus for tracing - Tracing is now enabled by default. Since Span operations are no-op's in @@ -13,7 +25,3 @@ inclusion of the whole query as an attribute on the OpenTelemetry Span started for a query. - Create child spans for queries in a transaction - -### Changed - -### Removed diff --git a/config/example.config b/config/example.config index 525bcc2..e9a6892 100644 --- a/config/example.config +++ b/config/example.config @@ -2,5 +2,6 @@ {pgo, [{pools, [{default, #{pool_size => 5, host => "127.0.0.1", database => "test", - user => "test"}}]}]} + user => "test", + password => "password"}}]}]} ]. diff --git a/config/sys.config b/config/sys.config new file mode 100644 index 0000000..63b18d4 --- /dev/null +++ b/config/sys.config @@ -0,0 +1,6 @@ +[{kernel, + [{logger_level, debug}, + {logger, + [{handler, default, logger_std_h, + #{level => debug, formatter => {logger_formatter, #{single_line => true}}}} + ]}]}]. diff --git a/docker-compose.yml b/docker-compose.yml index 86c0c22..9aea6d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,8 @@ services: - POSTGRES_DB=test - POSTGRES_PASSWORD=password - POSTGRES_HOST_AUTH_METHOD=scram-sha-256 + volumes: + - /tmp/postgresql:/var/run/postgresql ports: - 5432:5432 diff --git a/test/pgo_basic_SUITE.erl b/test/pgo_basic_SUITE.erl index b14e307..b89418f 100644 --- a/test/pgo_basic_SUITE.erl +++ b/test/pgo_basic_SUITE.erl @@ -10,16 +10,12 @@ -define(TXT_UUID, <<"727F42A6-E6A0-4223-9B72-6A5EB7436AB5">>). all() -> - case os:getenv("CIRCLECI") of - false -> - [{group, clear}, {group, ssl}]; - _ -> - [{group, clear}] - end. + [{group, clear}, {group, ssl}]. groups() -> [{clear, [], cases()}, - {ssl, [], cases()}]. + {ssl, [], [int4_range]}, + {domain_socket, [], [int4_range]}]. cases() -> [exceptions, select, insert_update, text_types, @@ -68,8 +64,24 @@ init_per_group(ssl, Config) -> user => "test", password => "password"}), + Config; +init_per_group(domain_socket, Config) -> + application:ensure_all_started(pgo), + + {ok, _} = pgo_sup:start_child(default, #{pool_size => 1, + port => 5432, + host => "/tmp/postgresql", + database => "test", + user => "test", + password => "password"}), + Config. + +end_per_group(Group, _Config) when Group =:= ssl ; Group =:= domain_socket -> + application:stop(pgo), + pgo_test_utils:clear_types(default), + ok; end_per_group(_, _Config) -> pgo:query("drop table tmp"), pgo:query("drop table tmp_b"),