mirror of https://github.com/citusdata/citus.git
Add support for running postgres tests against a database with citus loaded.
Not that this is not with the citus *extension* loaded, just the shared library. The former runs (by adding --use-existing to the flags) but has a bunch of trivial test differences.pull/1017/head
parent
a426c50a8c
commit
b65814280f
|
@ -53,6 +53,9 @@ check-isolation: all tempinstall-main
|
|||
$(pg_regress_multi_check) --load-extension=citus --isolationtester \
|
||||
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/isolation_schedule $(EXTRA_TESTS)
|
||||
|
||||
check-vanilla: all tempinstall-main
|
||||
$(pg_regress_multi_check) --load-extension=citus --vanillatest
|
||||
|
||||
check-multi-task-tracker-extra: all tempinstall-main
|
||||
$(pg_regress_multi_check) --load-extension=citus \
|
||||
--server-option=citus.task_executor_type=task-tracker \
|
||||
|
|
|
@ -27,6 +27,7 @@ sub Usage()
|
|||
print "\n";
|
||||
print "Multi Options:\n";
|
||||
print " --isolationtester Run isolationtester tests instead of plain tests\n";
|
||||
print " --vanillatest Run postgres tests with citus loaded as shared preload library\n";
|
||||
print " --bindir Path to postgres binary directory\n";
|
||||
print " --libdir Path to postgres library directory\n";
|
||||
print " --postgres-builddir Path to postgres build directory\n";
|
||||
|
@ -39,6 +40,7 @@ sub Usage()
|
|||
|
||||
# Option parsing
|
||||
my $isolationtester = 0;
|
||||
my $vanillatest = 0;
|
||||
my $bindir = "";
|
||||
my $libdir = undef;
|
||||
my $pgxsdir = "";
|
||||
|
@ -57,6 +59,7 @@ my $serversAreShutdown = "TRUE";
|
|||
|
||||
GetOptions(
|
||||
'isolationtester' => \$isolationtester,
|
||||
'vanillatest' => \$vanillatest,
|
||||
'bindir=s' => \$bindir,
|
||||
'libdir=s' => \$libdir,
|
||||
'pgxsdir=s' => \$pgxsdir,
|
||||
|
@ -109,6 +112,19 @@ directory is present locally
|
|||
MESSAGE
|
||||
}
|
||||
|
||||
my $vanillaRegress = "${postgresBuilddir}/src/test/regress/pg_regress";
|
||||
if ($vanillatest && ! -f "$vanillaRegress")
|
||||
{
|
||||
die <<"MESSAGE";
|
||||
|
||||
pg_regress (for vanilla tests) not found at $vanillaRegress.
|
||||
|
||||
Vanilla tests can only be run when source (detected as ${postgresSrcdir})
|
||||
and build (detected as ${postgresBuilddir}) directory corresponding to $bindir
|
||||
are present.
|
||||
MESSAGE
|
||||
}
|
||||
|
||||
# Set some default configuration options
|
||||
my $masterPort = 57636;
|
||||
my $workerCount = 2;
|
||||
|
@ -348,17 +364,26 @@ push(@arguments, @ARGV);
|
|||
my $startTime = time();
|
||||
|
||||
# Finally run the tests
|
||||
if (!$isolationtester)
|
||||
if ($vanillatest)
|
||||
{
|
||||
system("$plainRegress", @arguments) == 0
|
||||
or die "Could not run regression tests";
|
||||
push(@arguments, "--schedule=${postgresSrcdir}/parallel_schedule");
|
||||
$ENV{PGHOST} = $host;
|
||||
$ENV{PGPORT} = $masterPort;
|
||||
$ENV{PGUSER} = $user;
|
||||
|
||||
system("make -C $postgresBuilddir/src/test/regress installcheck-parallel")
|
||||
}
|
||||
else
|
||||
elsif ($isolationtester)
|
||||
{
|
||||
push(@arguments, "--dbname=regression");
|
||||
system("$isolationRegress", @arguments) == 0
|
||||
or die "Could not run isolation tests";
|
||||
}
|
||||
else
|
||||
{
|
||||
system("$plainRegress", @arguments) == 0
|
||||
or die "Could not run regression tests";
|
||||
}
|
||||
|
||||
my $endTime = time();
|
||||
|
||||
|
|
Loading…
Reference in New Issue