erleans / pgo

Erlang Postgres client and connection pool
Apache License 2.0
80 stars 16 forks source link

support for SCRAM-SHA-256 authentication #58

Closed tsloughter closed 2 years ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #58 (d7ea1e7) into master (96250d0) will increase coverage by 10.73%. The diff coverage is 75.14%.

@@             Coverage Diff             @@
##           master      #58       +/-   ##
===========================================
+ Coverage   53.63%   64.37%   +10.73%     
===========================================
  Files          13       14        +1     
  Lines        1251     1002      -249     
===========================================
- Hits          671      645       -26     
+ Misses        580      357      -223     
Impacted Files Coverage Δ
src/pgo_connection.erl 45.09% <7.14%> (-2.53%) :arrow_down:
src/pgo.erl 42.37% <20.00%> (-0.49%) :arrow_down:
src/pgo_pool.erl 60.11% <70.00%> (+7.51%) :arrow_up:
src/pgo_handler.erl 67.84% <71.55%> (+10.91%) :arrow_up:
src/pgo_scram.erl 77.58% <77.58%> (ø)
src/pgo_type_server.erl 65.71% <78.57%> (-0.96%) :arrow_down:
src/pgo_protocol.erl 55.96% <79.24%> (-1.89%) :arrow_down:
src/pgo_sasl_prep_profile.erl 91.13% <91.13%> (ø)
... and 2 more

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

lpil commented 2 years ago

Is there a way to hide all these coverage annotations? It's pretty hard to read the code in places because of them

edit: found a way to do it per-file. Bit slow bit works

image

tsloughter commented 2 years ago

Oh yea, so tests pass on earlier version of postgres :(. Very confusing.

tsloughter commented 2 years ago

Something is screwy because now I also see:

Failure/Error: ?assertMatch(# { command := insert }, pgo : query ( "insert into hstore_tmp (id, labels) values ($1, $2)" , [ 1 , # { << "key-1" >> => << "value-1" >> , << "key-2" >> => << "value-2" >> } ] ))
  expected: = # { command := insert }
       got: {error,
                #{error => badarg_encoding,module => pg_types,
                  type_info =>
                      {type_info,16428,pg_array,[],default,
                          <<"_foo_ts_range">>,<<"array_send">>,
                          <<"array_recv">>,-1,<<"array_out">>,<<"array_in">>,
                          16429,
                          {type_info,16429,pg_record,[],default,
                              <<"foo_ts_range">>,<<"record_send">>,
                              <<"record_recv">>,-1,<<"record_out">>,
                              <<"record_in">>,0,undefined,0,
                              [23,3908],
                              [{type_info,23,pg_int4,[],default,<<"int4">>,
                                   <<"int4send">>,<<"int4recv">>,4,
                                   <<"int4out">>,<<"int4in">>,0,undefined,0,
                                   [],undefined},
                               {type_info,3908,pg_range,[],default,
                                   <<"tsrange">>,<<"range_send">>,
                                   <<"range_recv">>,-1,<<"range_out">>,
                                   <<"range_in">>,0,undefined,1114,[],
                                   undefined}]},
                          0,[],undefined},
                  value =>
                      #{<<"key-1">> => <<"value-1">>,
                        <<"key-2">> => <<"value-2">>}}}
      line: 358

And sometimes the timestamp tests pass with postgres 14. First guess is something is crashing but for some reason not showing up in the logs but results in configuration being lost on following tests that would explain the timestamp failures at least.

benbro commented 2 years ago

Not sure if it's relevant but fixing several silent or unhandled errors might help expose these kind of issues: https://github.com/erleans/pgo/issues/57 https://github.com/erleans/pgo/issues/42 https://github.com/erleans/pgo/issues/41

tsloughter commented 2 years ago

@benbro very good point.

tsloughter commented 2 years ago

@benbro this might have worked!

I'm still finishing up the commits because I'm not positive how best to handle particular failures but I should have a PR open today or tomorrow.

tsloughter commented 2 years ago

Found a bug related to the socket death not being handled right by the connection process too. Hopefully will have that PR ready sometime today.

Neustradamus commented 2 years ago

Linked to: