Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-03-15 14:49:15 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-03-24 16:54:07 +0300
commit465664c6729caf45ee28063782780375f145aa83 (patch)
treed2c49dc341f8110113b4ed8d215b1960cdbc0825
parentfd5642b39f0b87f2bda5e4980675fda2888e655e (diff)
ci: Increase test coverage of PgBouncer job
The PgBouncer CI job is currently only executing the `test-postgres` target, which only exercises a subset of our test suite. It's much more sensible thoguh to instead execute `test-with-praefect` so that we can assert that a "real" Praefect proxy works alright in combination with PgBouncer. Do this conversion and remove the now-unused `test-postgres` target. Convert the job to run tests as unprivileged user so that we don't ignore permissions, or otherwise some of our tests would break.
-rw-r--r--.gitlab-ci.yml4
-rw-r--r--Makefile5
2 files changed, 3 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4a33e6d17..92bbe4302 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -218,7 +218,9 @@ test:pgbouncer:
- *test_before_script
- while ! psql -h "${PGHOST_PGBOUNCER}" -p "${PGPORT_PGBOUNCER}" -U "${PGUSER}" -c 'SELECT 1' > /dev/null; do echo "awaiting PgBouncer service to be ready..." && sleep 1 ; done && echo "PgBouncer service is ready!"
script:
- - make test-postgres
+ # We need to explicitly build all prerequisites so that we can run tests unprivileged.
+ - make build prepare-tests
+ - setpriv --reuid=9999 --regid=9999 --clear-groups --no-new-privs env HOME=/dev/null make test-with-praefect SKIP_RSPEC_BUILD=YesPlease
test:nightly:
<<: *test_definition
diff --git a/Makefile b/Makefile
index 590ac08d5..9c7f9f3b8 100644
--- a/Makefile
+++ b/Makefile
@@ -416,11 +416,6 @@ test-with-proxies: prepare-tests
test-with-praefect: prepare-tests
${Q}GITALY_TEST_WITH_PRAEFECT=YesPlease $(call run_go_tests)
-.PHONY: test-postgres
-## Run Go tests with Postgres.
-test-postgres: TEST_PACKAGES := gitlab.com/gitlab-org/gitaly/v14/internal/praefect/...
-test-postgres: test-go
-
.PHONY: race-go
## Run Go tests with race detection enabled.
race-go: TEST_OPTIONS := ${TEST_OPTIONS} -race