You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pg-promise init options causes local test to fail #3745
the pr #3613 introduces two unit tests that test postgres.
the parse-server test machinery only sets up a mongo test server, not a postgres test server, so if one is not running postgres, these test will fail when tests are run locally.
Running tests before creating a pr is a Good Thing™.
Would seem that there are two options here:
figure out how to conditionally not run these tests if postgres is not being tested
add postgres to test helper setup so the tests test....
Any thoughts? Would seem that option 2 is better even though it'd likely make tests take longer?
uh-oh "should fail to create server if schema databaseOptions does not exist" appears to be flaky too. on travis, it failed with something like "expected 3000 to be 42P01" but when i re-ran it it just worked :( -- after looking back and seeing that it had worked on the initial commit...
The titled alarmed at first as an issue with pg-promise, but then reading through posts, plus that PR, seems like it is not really an issue with the library, rather with how tests are being run...?
Anyway, I'm here to help figure it out, if needed 😉
Would it be possible that the connect call is not run sometimes? I know mongo connects on the 1st call but not on new instance or that reconfigureServer swallows the error?
On every query request pg-promise acquires next available connection from the pool. When no connection has been created yet, a new one is created. The connection is released back to the pool immediately after the query execution. It is only different when using explicit connect method, which I believe is not used by this library.
Activity
acinader commentedon Apr 23, 2017
uh-oh "should fail to create server if schema databaseOptions does not exist" appears to be flaky too. on travis, it failed with something like "expected 3000 to be 42P01" but when i re-ran it it just worked :( -- after looking back and seeing that it had worked on the initial commit...
acinader commentedon Apr 23, 2017
@paulovitin ^^^ thoughts welcome :)
paulovitin commentedon Apr 24, 2017
@acinader for test postgres we need the env var PARSE_SERVER_TEST_DB to run in postgres. Why not to use this for conditionally not run these tests?
flovilmart commentedon Apr 24, 2017
We do, it_excludes_db etc...
vitaly-t commentedon Apr 24, 2017
The titled alarmed at first as an issue with pg-promise, but then reading through posts, plus that PR, seems like it is not really an issue with the library, rather with how tests are being run...?
Anyway, I'm here to help figure it out, if needed 😉
flovilmart commentedon Apr 24, 2017
Would it be possible that the connect call is not run sometimes? I know mongo connects on the 1st call but not on new instance or that reconfigureServer swallows the error?
vitaly-t commentedon Apr 24, 2017
On every query request
pg-promiseacquires next available connection from the pool. When no connection has been created yet, a new one is created. The connection is released back to the pool immediately after the query execution. It is only different when using explicitconnectmethod, which I believe is not used by this library.acinader commentedon Apr 25, 2017
ok, bad me for putting two separate issues into one issue....
I just opened #3754 for the flaky tests failures.
So this issue should just address running tests locally if you don't have postgres setup causes spec/PostgresInitOptions.spec.js tests to fail.....
dplewis commentedon Mar 23, 2018
Closed via #3822