Conversation
1666876 to
04afd97
Compare
04afd97 to
0503586
Compare
| @@ -1,13 +1,13 @@ | |||
| #!/bin/bash | |||
| # bash strict mode | |||
| set -euo pipefail | |||
There was a problem hiding this comment.
Did this cause issues?
It forces the bash script to fail if some component fails and that is generally the sane thing to do.
See bash strict mode.
There was a problem hiding this comment.
I removed it, so I can use trap command here
| TEST_CASE_DB="ldb_${TESTFILE_NAME}" | ||
|
|
||
| # Drop db after each test on exit signal | ||
| function drop_db { |
There was a problem hiding this comment.
pg_regress has the option of running tests in parallel. How does that option interact with this dropping logic?
There was a problem hiding this comment.
Yes currently all the tests are being run in parallel, and each test case is creating a database for it's own with the name like ldb_hnsw or ldb_hnsw_inserts like this.
test/test_runner.sh
Outdated
| # install lanterndb extension | ||
| psql "$@" -U postgres -d postgres -v ECHO=none -q -c "DROP DATABASE IF EXISTS ${TEST_CASE_DB};" 2>/dev/null | ||
| psql "$@" -U postgres -d postgres -v ECHO=none -q -c "DROP DATABASE IF EXISTS ${TEST_CASE_DB};" 2>/dev/null | ||
| psql "$@" -U postgres -d postgres -v ECHO=none -q -c "CREATE DATABASE ${TEST_CASE_DB};" 2>/dev/null |
There was a problem hiding this comment.
From postgres docs
When using installcheck mode, these tests will create and destroy test databases whose names include regression, for example pl_regression or contrib_regression. Beware of using installcheck mode with an installation that has any non-test databases named that way.
It seems the upstream approach is to create and restroy databases hosting the tests, in stead of using an existing database. We should follow the same convention.
There was a problem hiding this comment.
Yes actually we are creating and destroying the database after each test case, I just put IF EXISTS here, so if the script will be terminated in the middle it won't cause any issues in next run.
Description
Run tests with
pg_regressinstead of doing it manuallyTODO
Issue
closes #43