From 5db45bac45d9ad83d522278df936bc85f700a69f Mon Sep 17 00:00:00 2001 From: Jason Petersen Date: Tue, 26 Feb 2019 22:17:26 -0700 Subject: [PATCH] Enable CircleCI The configuration for the build is in the YAML file; the changes to the regression runner are backward-compatible with Travis and just add the logic to detect whether our custom (isolation- and vanilla-enabled) pkg is present. --- .circleci/config.yml | 81 ++++++++++++++++++++++++++++ src/test/regress/pg_regress_multi.pl | 27 ++++++++-- 2 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..41a45855e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,81 @@ +version: 2.0 + +jobs: + build: + docker: + - {image: 'citusdata/extbuilder:latest'} + steps: + - checkout + - {run: {name: 'Configure, Build, and Install', command: build-ext}} + - {persist_to_workspace: {root: ., paths: [.]}} + test-10_check-multi: + docker: + - {image: 'citusdata/exttester-10:latest'} + working_directory: /home/circleci/project + steps: + - {attach_workspace: {at: .}} + - {run: {name: 'Install and Test (check-multi)', command: 'install-and-test-ext check-multi'}} + test-10_check-tt-van-mx: + docker: + - {image: 'citusdata/exttester-10:latest'} + working_directory: /home/circleci/project + steps: + - {attach_workspace: {at: .}} + - {run: {name: 'Install and Test (check-tt-van-mx)', command: 'install-and-test-ext check-multi-task-tracker-extra check-vanilla check-multi-mx'}} + test-10_check-iso-work-fol: + docker: + - {image: 'citusdata/exttester-10:latest'} + working_directory: /home/circleci/project + steps: + - {attach_workspace: {at: .}} + - {run: {name: 'Install and Test (check-iso-work-fol)', command: 'install-and-test-ext check-isolation check-worker check-follower-cluster'}} + test-10_check-failure: + docker: + - {image: 'citusdata/failtester-10:latest'} + working_directory: /home/circleci/project + steps: + - {attach_workspace: {at: .}} + - {run: {name: 'Install and Test (check-failure)', command: 'install-and-test-ext check-failure'}} + test-11_check-multi: + docker: + - {image: 'citusdata/exttester-11:latest'} + working_directory: /home/circleci/project + steps: + - {attach_workspace: {at: .}} + - {run: {name: 'Install and Test (check-multi)', command: 'install-and-test-ext check-multi'}} + test-11_check-tt-van-mx: + docker: + - {image: 'citusdata/exttester-11:latest'} + working_directory: /home/circleci/project + steps: + - {attach_workspace: {at: .}} + - {run: {name: 'Install and Test (check-tt-van-mx)', command: 'install-and-test-ext check-multi-task-tracker-extra check-vanilla check-multi-mx'}} + test-11_check-iso-work-fol: + docker: + - {image: 'citusdata/exttester-11:latest'} + working_directory: /home/circleci/project + steps: + - {attach_workspace: {at: .}} + - {run: {name: 'Install and Test (check-iso-work-fol)', command: 'install-and-test-ext check-isolation check-worker check-follower-cluster'}} + test-11_check-failure: + docker: + - {image: 'citusdata/failtester-11:latest'} + working_directory: /home/circleci/project + steps: + - {attach_workspace: {at: .}} + - {run: {name: 'Install and Test (check-failure)', command: 'install-and-test-ext check-failure'}} +workflows: + version: 2 + build_and_test: + jobs: + - build + + - {test-10_check-multi: {requires: [build]}} + - {test-10_check-tt-van-mx: {requires: [build]}} + - {test-10_check-iso-work-fol: {requires: [build]}} + - {test-10_check-failure: {requires: [build]}} + + - {test-11_check-multi: {requires: [build]}} + - {test-11_check-tt-van-mx: {requires: [build]}} + - {test-11_check-iso-work-fol: {requires: [build]}} + - {test-11_check-failure: {requires: [build]}} diff --git a/src/test/regress/pg_regress_multi.pl b/src/test/regress/pg_regress_multi.pl index c9846675d..d3eb1b681 100755 --- a/src/test/regress/pg_regress_multi.pl +++ b/src/test/regress/pg_regress_multi.pl @@ -16,6 +16,7 @@ use warnings; use Fcntl; use Getopt::Long; +use File::Basename; use File::Spec::Functions; use File::Path qw(make_path remove_tree); use Config; @@ -151,6 +152,11 @@ else $plainRegress = "$pgxsdir/src/test/regress/pg_regress"; $isolationRegress = "${postgresBuilddir}/src/test/isolation/pg_isolation_regress"; $pgConfig = "$bindir/pg_config"; + + if (-x "$pgxsdir/src/test/isolation/pg_isolation_regress") + { + $isolationRegress = "$pgxsdir/src/test/isolation/pg_isolation_regress"; + } } if ($isolationtester && ! -f "$isolationRegress") @@ -171,7 +177,9 @@ MESSAGE } my $vanillaRegress = catfile("${postgresBuilddir}", "src", "test", "regress", "pg_regress"); -if ($vanillatest && ! -f "$vanillaRegress") +my $vanillaSchedule = catfile(dirname("${pgxsdir}"), "regress", "parallel_schedule"); + +if ($vanillatest && ! (-f "$vanillaRegress" or -f "$vanillaSchedule")) { die <<"MESSAGE"; @@ -796,8 +804,21 @@ if ($vanillatest) $ENV{PGPORT} = $masterPort; $ENV{PGUSER} = $user; - system("make", ("-C", catfile("$postgresBuilddir", "src", "test", "regress"), "installcheck-parallel")) == 0 - or die "Could not run vanilla tests"; + if (-f "$vanillaSchedule") + { + rmdir "./testtablespace"; + mkdir "./testtablespace"; + + my $pgregressdir=catfile(dirname("$pgxsdir"), "regress"); + system("$plainRegress", ("--inputdir", $pgregressdir), + ("--schedule", catfile("$pgregressdir", "parallel_schedule"))) == 0 + or die "Could not run vanilla tests"; + } + else + { + system("make", ("-C", catfile("$postgresBuilddir", "src", "test", "regress"), "installcheck-parallel")) == 0 + or die "Could not run vanilla tests"; + } } elsif ($isolationtester) {