Skip to content

Commit

Permalink
add test of domain_socket support (#94)
Browse files Browse the repository at this point in the history
* add test of domain_socket support

* update changelog
  • Loading branch information
tsloughter authored Nov 17, 2024
1 parent 9fb169e commit 7f39da0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 12 deletions.
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
3 changes: 2 additions & 1 deletion config/example.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
{pgo, [{pools, [{default, #{pool_size => 5,
host => "127.0.0.1",
database => "test",
user => "test"}}]}]}
user => "test",
password => "password"}}]}]}
].
6 changes: 6 additions & 0 deletions config/sys.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[{kernel,
[{logger_level, debug},
{logger,
[{handler, default, logger_std_h,
#{level => debug, formatter => {logger_formatter, #{single_line => true}}}}
]}]}].
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 19 additions & 7 deletions test/pgo_basic_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit 7f39da0

Please sign in to comment.