pull/8361/merge
eaydingol 2025-12-08 08:59:00 +03:00 committed by GitHub
commit d657a9f839
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 140 additions and 125 deletions

View File

@ -132,126 +132,59 @@ jobs:
./build-${{ env.PG_MAJOR }}/* ./build-${{ env.PG_MAJOR }}/*
./install-${{ env.PG_MAJOR }}.tar ./install-${{ env.PG_MAJOR }}.tar
test-citus: test-citus:
name: PG${{ fromJson(matrix.pg_version).major }} - ${{ matrix.make }} name: Test Citus
strategy: uses: ./.github/workflows/run_tests.yml
fail-fast: false
matrix:
suite:
- regress
image_name:
- ${{ needs.params.outputs.test_image_name }}
pg_version:
- ${{ needs.params.outputs.pg15_version }}
- ${{ needs.params.outputs.pg16_version }}
- ${{ needs.params.outputs.pg17_version }}
make:
- check-split
- check-multi
- check-multi-1
- check-multi-mx
- check-vanilla
- check-isolation
- check-operations
- check-follower-cluster
- check-add-backup-node
- check-columnar
- check-columnar-isolation
- check-enterprise
- check-enterprise-isolation
- check-enterprise-isolation-logicalrep-1
- check-enterprise-isolation-logicalrep-2
- check-enterprise-isolation-logicalrep-3
include:
- make: check-failure
pg_version: ${{ needs.params.outputs.pg15_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-failure
pg_version: ${{ needs.params.outputs.pg16_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-failure
pg_version: ${{ needs.params.outputs.pg17_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-enterprise-failure
pg_version: ${{ needs.params.outputs.pg15_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-enterprise-failure
pg_version: ${{ needs.params.outputs.pg16_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-enterprise-failure
pg_version: ${{ needs.params.outputs.pg17_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-pytest
pg_version: ${{ needs.params.outputs.pg15_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-pytest
pg_version: ${{ needs.params.outputs.pg16_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-pytest
pg_version: ${{ needs.params.outputs.pg17_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: installcheck
suite: cdc
image_name: ${{ needs.params.outputs.test_image_name }}
pg_version: ${{ needs.params.outputs.pg15_version }}
- make: installcheck
suite: cdc
image_name: ${{ needs.params.outputs.test_image_name }}
pg_version: ${{ needs.params.outputs.pg16_version }}
- make: installcheck
suite: cdc
image_name: ${{ needs.params.outputs.test_image_name }}
pg_version: ${{ needs.params.outputs.pg17_version }}
- make: check-query-generator
pg_version: ${{ needs.params.outputs.pg15_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-query-generator
pg_version: ${{ needs.params.outputs.pg16_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
- make: check-query-generator
pg_version: ${{ needs.params.outputs.pg17_version }}
suite: regress
image_name: ${{ needs.params.outputs.fail_test_image_name }}
runs-on: ubuntu-latest
container:
image: "${{ matrix.image_name }}:${{ fromJson(matrix.pg_version).full }}${{ needs.params.outputs.image_suffix }}"
options: >-
--user root
--dns=8.8.8.8
--cap-add=SYS_NICE
--security-opt seccomp=unconfined
# Due to Github creates a default network for each job, we need to use
# --dns= to have similar DNS settings as our other CI systems or local
# machines. Otherwise, we may see different results.
# and grant caps so PG18's NUMA introspection (pg_shmem_allocations_numa -> move_pages)
# doesn't fail with EPERM in CI.
needs: needs:
- params - params
- build - build
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup_extension"
- name: Run Test
run: gosu circleci make -C src/test/${{ matrix.suite }} ${{ matrix.make }}
timeout-minutes: 20
- uses: "./.github/actions/save_logs_and_results"
if: always()
with: with:
folder: ${{ fromJson(matrix.pg_version).major }}_${{ matrix.make }} pg_versions: >
- uses: "./.github/actions/upload_coverage" [
if: always() ${{ needs.params.outputs.pg15_version }},
${{ needs.params.outputs.pg16_version }},
${{ needs.params.outputs.pg17_version }}
]
make_targets: '["check-split", "check-multi", "check-multi-1", "check-multi-mx", "check-vanilla", "check-isolation", "check-operations", "check-follower-cluster", "check-add-backup-node", "check-columnar", "check-columnar-isolation", "check-enterprise", "check-enterprise-isolation", "check-enterprise-isolation-logicalrep-1", "check-enterprise-isolation-logicalrep-2", "check-enterprise-isolation-logicalrep-3"]'
image_suffix: ${{ needs.params.outputs.image_suffix }}
image_name: ${{ needs.params.outputs.test_image_name }}
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
test-citus-failure:
name: Test Citus Failure
uses: ./.github/workflows/run_tests.yml
needs:
- params
- build
with: with:
flags: ${{ env.PG_MAJOR }}_${{ matrix.suite }}_${{ matrix.make }} pg_versions: >
[
${{ needs.params.outputs.pg15_version }},
${{ needs.params.outputs.pg16_version }},
${{ needs.params.outputs.pg17_version }}
]
make_targets: '["check-failure", "check-enterprise-failure", "check-pytest", "check-query-generator"]'
image_suffix: ${{ needs.params.outputs.image_suffix }}
image_name: ${{ needs.params.outputs.fail_test_image_name }}
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
test-citus-cdc:
name: Test Citus CDC
uses: ./.github/workflows/run_tests.yml
needs:
- params
- build
with:
pg_versions: >
[
${{ needs.params.outputs.pg15_version }},
${{ needs.params.outputs.pg16_version }},
${{ needs.params.outputs.pg17_version }}
]
make_targets: '["installcheck"]'
image_suffix: ${{ needs.params.outputs.image_suffix }}
image_name: ${{ needs.params.outputs.test_image_name }}
suite: cdc
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }} codecov_token: ${{ secrets.CODECOV_TOKEN }}
test-arbitrary-configs: test-arbitrary-configs:
name: PG${{ fromJson(matrix.pg_version).major }} - check-arbitrary-configs-${{ matrix.parallel }} name: PG${{ fromJson(matrix.pg_version).major }} - check-arbitrary-configs-${{ matrix.parallel }}

59
.github/workflows/run_tests.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: Run Tests
on:
workflow_call:
inputs:
pg_versions:
required: true
type: string
make_targets:
required: true
type: string
image_suffix:
required: true
type: string
image_name:
required: true
type: string
suite:
required: false
type: string
default: "regress"
citus_version:
required: false
type: string
default: ""
secrets:
codecov_token:
required: false
jobs:
test:
name: PG${{ matrix.pg_version.major }} - ${{ matrix.make }}${{ inputs.citus_version && format(' - {0}', inputs.citus_version) || '' }}
strategy:
fail-fast: false
matrix:
pg_version: ${{ fromJson(inputs.pg_versions) }}
make: ${{ fromJson(inputs.make_targets) }}
runs-on: ubuntu-latest
container:
image: "${{ inputs.image_name }}:${{ matrix.pg_version.full }}${{ inputs.image_suffix }}"
options: >-
--user root
--dns=8.8.8.8
--cap-add=SYS_NICE
--security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/setup_extension"
- name: Run Test
run: CITUSVERSION=${{ inputs.citus_version }} gosu circleci make -C src/test/${{ inputs.suite }} ${{ matrix.make }}
timeout-minutes: 20
- uses: "./.github/actions/save_logs_and_results"
if: always()
with:
folder: ${{ matrix.pg_version.major }}_${{ matrix.make }}${{ inputs.citus_version && format('_{0}', inputs.citus_version) || '' }}
- uses: "./.github/actions/upload_coverage"
if: always()
with:
flags: ${{ env.PG_MAJOR }}_${{ inputs.suite }}_${{ matrix.make }}
codecov_token: ${{ secrets.codecov_token }}

View File

@ -10,6 +10,9 @@ ifndef MAJORVERSION
MAJORVERSION := $(basename $(VERSION)) MAJORVERSION := $(basename $(VERSION))
endif endif
ifndef CITUSVERSION
CITUSVERSION := ""
endif
# Add ./bin to $PATH so we use our custom diff instead of the default diff tool. # Add ./bin to $PATH so we use our custom diff instead of the default diff tool.
# We do this to be able to mask shard Ids, placement Ids, node ports, etc. # We do this to be able to mask shard Ids, placement Ids, node ports, etc.
MAKEFILE_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) MAKEFILE_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
@ -28,7 +31,7 @@ export PGISOLATIONTIMEOUT = 60
## Citus regression support ## Citus regression support
## ##
MULTI_INSTALLDIR=$(CURDIR)/tmp_check/install MULTI_INSTALLDIR=$(CURDIR)/tmp_check/install
pg_regress_multi_check = $(PERL) $(citus_abs_srcdir)/pg_regress_multi.pl --pgxsdir="$(pgxsdir)" --bindir="$(bindir)" --libdir="$(libdir)" --majorversion="$(MAJORVERSION)" --postgres-builddir="$(postgres_abs_builddir)" --postgres-srcdir="$(postgres_abs_srcdir)" --citus_abs_srcdir="$(citus_abs_srcdir)" pg_regress_multi_check = $(PERL) $(citus_abs_srcdir)/pg_regress_multi.pl --pgxsdir="$(pgxsdir)" --bindir="$(bindir)" --libdir="$(libdir)" --majorversion="$(MAJORVERSION)" --postgres-builddir="$(postgres_abs_builddir)" --postgres-srcdir="$(postgres_abs_srcdir)" --citus_abs_srcdir="$(citus_abs_srcdir)" --citus-version=$(CITUSVERSION)
MULTI_REGRESS_OPTS = --inputdir=$(citus_abs_srcdir) $(pg_regress_locale_flags) --launcher="$(citus_abs_srcdir)/log_test_times" MULTI_REGRESS_OPTS = --inputdir=$(citus_abs_srcdir) $(pg_regress_locale_flags) --launcher="$(citus_abs_srcdir)/log_test_times"
pg_upgrade_check = $(citus_abs_srcdir)/citus_tests/upgrade/pg_upgrade_test.py pg_upgrade_check = $(citus_abs_srcdir)/citus_tests/upgrade/pg_upgrade_test.py
@ -157,6 +160,7 @@ check-multi: all
check-enterprise: all check-enterprise: all
$(pg_regress_multi_check) --load-extension=citus \ $(pg_regress_multi_check) --load-extension=citus \
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/enterprise_schedule $(EXTRA_TESTS) -- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/enterprise_schedule $(EXTRA_TESTS)
check-multi-1: all check-multi-1: all
$(pg_regress_multi_check) --load-extension=citus \ $(pg_regress_multi_check) --load-extension=citus \
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_1_schedule $(EXTRA_TESTS) -- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_1_schedule $(EXTRA_TESTS)

View File

@ -50,6 +50,7 @@ sub Usage()
print " --connection-timeout Timeout for connecting to worker nodes\n"; print " --connection-timeout Timeout for connecting to worker nodes\n";
print " --mitmproxy Start a mitmproxy for one of the workers\n"; print " --mitmproxy Start a mitmproxy for one of the workers\n";
print " --worker-count Number of workers in Citus cluster (default: 2)\n"; print " --worker-count Number of workers in Citus cluster (default: 2)\n";
print " --citus-version Citus version being tested (used for during extension create)\n";
exit 1; exit 1;
} }
@ -87,6 +88,7 @@ my $conninfo = "";
my $publicWorker1Host = "localhost"; my $publicWorker1Host = "localhost";
my $publicWorker2Host = "localhost"; my $publicWorker2Host = "localhost";
my $workerCount = 2; my $workerCount = 2;
my $citusversion = "";
my $serversAreShutdown = "TRUE"; my $serversAreShutdown = "TRUE";
my $usingWindows = 0; my $usingWindows = 0;
@ -121,6 +123,7 @@ GetOptions(
'worker-1-public-hostname=s' => \$publicWorker1Host, 'worker-1-public-hostname=s' => \$publicWorker1Host,
'worker-2-public-hostname=s' => \$publicWorker2Host, 'worker-2-public-hostname=s' => \$publicWorker2Host,
'worker-count=i' => \$workerCount, 'worker-count=i' => \$workerCount,
'citus-version=s' => \$citusversion,
'help' => sub { Usage() }); 'help' => sub { Usage() });
my $fixopen = "$bindir/postgres.fixopen"; my $fixopen = "$bindir/postgres.fixopen";
@ -590,6 +593,12 @@ if($isolationtester)
push(@pgOptions, "citus.background_task_queue_interval=-1"); push(@pgOptions, "citus.background_task_queue_interval=-1");
} }
if($citusversion)
{
push(@pgOptions, "citus.enable_version_checks=off");
push(@pgOptions, "columnar.enable_version_checks=off");
}
# Add externally added options last, so they overwrite the default ones above # Add externally added options last, so they overwrite the default ones above
for my $option (@userPgOptions) for my $option (@userPgOptions)
{ {
@ -989,12 +998,22 @@ if (!$conninfo)
or die "Could not find citus as first library in shared_preload_libraries on worker $port."; or die "Could not find citus as first library in shared_preload_libraries on worker $port.";
for my $extension (@extensions) for my $extension (@extensions)
{
if ($extension eq "citus" && $citusversion ne "")
{
system(catfile($bindir, "psql"),
('-X', '-h', $host, '-p', $port, '-U', $user, "-d", "regression",
'-c', "CREATE EXTENSION IF NOT EXISTS $extension VERSION '$citusversion';")) == 0
or die "Could not create extension $extension on worker port $port.";
}
else
{ {
system(catfile($bindir, "psql"), system(catfile($bindir, "psql"),
('-X', '-h', $host, '-p', $port, '-U', $user, "-d", "regression", ('-X', '-h', $host, '-p', $port, '-U', $user, "-d", "regression",
'-c', "CREATE EXTENSION IF NOT EXISTS $extension;")) == 0 '-c', "CREATE EXTENSION IF NOT EXISTS $extension;")) == 0
or die "Could not create extension $extension on worker port $port."; or die "Could not create extension $extension on worker port $port.";
} }
}
foreach my $function (keys %functions) foreach my $function (keys %functions)
{ {