diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-07-14 15:49:01 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-09 11:15:05 +0300 |
commit | c61cdadb5838604164f75be508df6ef4f8538310 (patch) | |
tree | 7d6efb53c750e786e51d59ad18744157cf70ccf5 /.gitlab-ci.yml | |
parent | 5c22de95a1637fe88a8913025610b279a947fffc (diff) |
Replace in-memory queue with Postgres implementation
To get more realistic tests we replace in-memory implementation
of the replication events queue with Postgres based.
It will require Postgres database to be available during unit-test
execution, but now it is not a problem as it is required for the
test-with-postgres task already. The caller is now responsible for
providing PGPORT, PGHOST and PGUSER env vars properly configured
before the test run.
As the tests run in parallel for each packages and each package has
its own database there is no problem of concurrent data change
until we have parallel tests running inside one package.
The name of the database is generated based on the package name
where from the setup function is called.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04ecf435b..e7cb74dda 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -147,9 +147,17 @@ binaries: test: <<: *test_definition image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-${RUBY_VERSION}-golang-${GO_VERSION}-git-2.31 + services: + - postgres:11.8 + variables: + PGHOST: postgres + PGPORT: "5432" + PGUSER: postgres + POSTGRES_HOST_AUTH_METHOD: trust script: - go version - _build/deps/git/install/bin/git version + - while ! psql -h $PGHOST -U $PGUSER -c 'SELECT 1' > /dev/null; do echo "awaiting Postgres service to be ready..." && sleep 1 ; done && echo "Postgres service is ready!" # This command will make all directories except of our build directory and Ruby code unwritable. # The purpose is to verify that there is no test which writes into those directories anymore, as # they should all instead use a temporary directory for runtime data. |