From 8a26071d06cbffa26c5ae5017f4bb55b9bdb3879 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 20 Dec 2022 20:19:23 +0000 Subject: [PATCH] ci: configure the database to run two-phase-commit tests We can't use the Github Actions PostgreSQL service because it doesn't seem possible to configure the server for stored transactions: - the service yaml definition doesn't take args to pass to run - we can't overwrite the entry point with a script of ours because the service starts before actions/checkout - the postgres image doesn't allow to pass extra parameters to the server via an env var --- .github/workflows/tests.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f6a7f535..cd263bdab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,6 +58,15 @@ jobs: with: python-version: ${{ matrix.python }} + - name: Run PostgreSQL + # Note: this would love to be a service, but I don't see a way to pass + # the args to the docker run command line. + run: | + docker pull ${{ matrix.postgres }} + docker run --rm -d --name postgres -p 5432:5432 \ + -e POSTGRES_PASSWORD=password ${{ matrix.postgres }} \ + -c max_prepared_transactions=10 + - name: Install the newest libpq version available if: ${{ matrix.libpq == 'newest' }} run: | @@ -108,20 +117,6 @@ jobs: - name: Run tests run: ./tools/build/ci_test.sh - services: - postgresql: - image: ${{ matrix.postgres }} - env: - POSTGRES_PASSWORD: password - ports: - - 5432:5432 - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - # }}} -- 2.47.2