Replace denormalized test output with normalized at the end of the run

pull/3425/head
Jelte Fennema 2020-01-24 11:41:33 +01:00
parent 4519d3411d
commit c38446b5f5
2 changed files with 31 additions and 11 deletions

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
# This is to make the following command work to update the test output:
# cp src/test/regress/{results,expected}/multi_cluster_management.out
#
# This can not be done in the custom "diff" command, because that is executed
# multiple times
for modified_file in {results,expected}/*.modified; do
original=${modified_file%.modified}
mv "$original" "$original.unmodified"
mv "$modified_file" "$original"
done

View File

@ -783,6 +783,8 @@ push(@arguments, @ARGV);
my $startTime = time(); my $startTime = time();
my $exitcode = 0;
# Finally run the tests # Finally run the tests
if ($vanillatest) if ($vanillatest)
{ {
@ -797,30 +799,33 @@ if ($vanillatest)
mkdir "./testtablespace"; mkdir "./testtablespace";
my $pgregressdir=catfile(dirname("$pgxsdir"), "regress"); my $pgregressdir=catfile(dirname("$pgxsdir"), "regress");
system("$plainRegress", ("--inputdir", $pgregressdir), $exitcode = system("$plainRegress", ("--inputdir", $pgregressdir),
("--schedule", catfile("$pgregressdir", "parallel_schedule"))) == 0 ("--schedule", catfile("$pgregressdir", "parallel_schedule")))
or die "Could not run vanilla tests";
} }
else else
{ {
system("make", ("-C", catfile("$postgresBuilddir", "src", "test", "regress"), "installcheck-parallel")) == 0 $exitcode = system("make", ("-C", catfile("$postgresBuilddir", "src", "test", "regress"), "installcheck-parallel"))
or die "Could not run vanilla tests";
} }
} }
elsif ($isolationtester) elsif ($isolationtester)
{ {
push(@arguments, "--dbname=regression"); push(@arguments, "--dbname=regression");
system("$isolationRegress", @arguments) == 0 $exitcode = system("$isolationRegress", @arguments)
or die "Could not run isolation tests";
} }
else else
{ {
system("$plainRegress", @arguments) == 0 $exitcode = system("$plainRegress", @arguments);
or die "Could not run regression tests";
} }
system (catfile("bin", "copy_modified"));
my $endTime = time(); my $endTime = time();
print "Finished in ". ($endTime - $startTime)." seconds. \n"; if ($exitcode == 0) {
print "Finished in ". ($endTime - $startTime)." seconds. \n";
exit 0;
}
else {
die "Failed in ". ($endTime - $startTime)." seconds. \n";
}
exit 0;