From d416d25518e11b82693effb8a873b59613436f69 Mon Sep 17 00:00:00 2001 From: Alexey Savchkov Date: Tue, 8 Aug 2023 22:24:12 +0700 Subject: [PATCH] Rename all to Python --- .github/workflows/test.yml | 16 ++++++++++++---- Makefile | 13 ++++++++----- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1bcb5c..c9808b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,14 +17,14 @@ jobs: pg_version: [15] # pg_version: [11, 12, 13, 14, 15] os: [ubuntu-22.04] - tests: [tap, all] + tests: [tap, python] test_mode: [normal, legacy, paranoia] exclude: - tests: tap test_mode: paranoia - - tests: all + - tests: python test_mode: normal - - tests: all + - tests: python test_mode: legacy fail-fast: false name: ${{ format('Ptrack ({0}, PostgreSQL {1}, {2} tests, {3} mode)', matrix.os, matrix.pg_version, matrix.tests, matrix.test_mode) }} @@ -49,6 +49,11 @@ jobs: uses: actions/checkout@v3 with: path: ptrack + - name: Get Pg_probackup sources + uses: actions/checkout@v3 + with: + repository: postgrespro/pg_probackup + path: pg_probackup - name: Apply ptrack patches run: make patch working-directory: ptrack @@ -66,12 +71,15 @@ jobs: - name: Install Ptrack run: make install USE_PGXS=1 working-directory: ptrack + - name: Install Pg_probackup + run: make install-pg-probackup + working-directory: ptrack # The sources are checked out by the root but ptrack tests need to write # to the source tree - name: Change the permissions of the ptrack folder run: chown "dev:" ptrack - name: Test - run: make test + run: make test-${{ matrix.tests }} working-directory: ptrack shell: runuser dev {0} runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 6f27e87..6e838f4 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ PG_CONFIG ?= pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) else -top_builddir ?= ../postgres +top_builddir ?= $(CURDIR)/../postgres # Makefile.global is a build artifact and initially may not be available ifneq ($(wildcard $(top_builddir)/src/Makefile.global), ) include $(top_builddir)/src/Makefile.global @@ -52,14 +52,18 @@ install-postgres: # Now when Postgres is built we can use PGXS for all remainig targets USE_PGXS = 1 -test: -ifeq ($(TESTS), tap) +test-tap: ifeq ($(TEST_MODE), legacy) setarch x86_64 --addr-no-randomize $(MAKE) installcheck else $(MAKE) installcheck endif -else + +pg_probackup_dir ?= $(CURDIR)/../pg_probackup +install-pg-probackup: + $(MAKE) -j $(nproc) -C $(pg_probackup_dir) install + +test-python: env=PG_PROBACKUP_PTRACK=ON; \ if [ "$(TEST_MODE)" = basic ]; then \ env="$$env PG_PROBACKUP_TEST_BASIC=ON"; \ @@ -72,4 +76,3 @@ else tests=tests.ptrack.PtrackTest."$(TEST_CASE)"; \ fi; \ env $$env python3 -m unittest -v "$$tests" -endif