Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support running optional steps and isolation checks.

The in initial optional steps supported are building the docs, and
finding typedefs, which can now be configured in a mich less kludgy way
than before. There is a lot of configurability about which optional
steps are run and when they run. We could easily extend this to run
some simple pgbench testing.

The isolation checks are new in 9.1, and so only run if the relevant
directory is found.
  • Loading branch information...
commit 61e8ca8059d6c02d826c82cbb95f98535a4ea559 1 parent 501d266
@adunstan adunstan authored
Showing with 125 additions and 3 deletions.
  1. +9 −0 build-farm.conf
  2. +116 −3 run_build.pl
View
9 build-farm.conf
@@ -162,6 +162,15 @@ my $branch;
],
},
+ optional_steps =>
+ {
+ # which optional steps to run and when to run them
+ # valid keys are: branches, dow, min_hours_since, min_hour, max_hour
+ # find_typedefs => { branches => ['HEAD'], dow => [1,4],
+ # min_hours_since => 25 },
+ # build_docs => {min_hours_since => 24},
+ },
+
# locales to test
locales => [ qw( C )],
View
119 run_build.pl
@@ -128,11 +128,11 @@
# get the config data into some local variables
my ($buildroot,$target,$animal, $print_success, $aux_path, $trigger_filter,
- $secret, $keep_errs, $force_every, $make,
+ $secret, $keep_errs, $force_every, $make, $optional_steps,
$use_vpath, $tar_log_cmd, $using_msvc, $extra_config ) =
@PGBuild::conf{
qw(build_root target animal print_success aux_path trigger_filter
- secret keep_error_builds force_every make
+ secret keep_error_builds force_every make optional_steps
use_vpath tar_log_cmd using_msvc extra_config)
};
@@ -558,6 +558,13 @@ END
make_check();
+if (-d "$pgsql/src/test/isolation")
+{
+ print time_str(),"running make isolation check ...\n" if $verbose;
+
+ make_isolation_check();
+}
+
unless ($using_msvc)
{
print time_str(),"running make contrib ...\n" if $verbose;
@@ -565,6 +572,13 @@ END
make_contrib();
}
+if (check_optional_step('build_docs'))
+{
+ print time_str(),"running make doc ...\n" if $verbose;
+
+ make_doc();
+}
+
print time_str(),"running make install ...\n" if $verbose;
make_install();
@@ -637,7 +651,7 @@ END
make_ecpg_check();
}
-if ($find_typedefs)
+if (check_optional_step('find_typedefs') || $find_typedefs)
{
print time_str(),"running find_typedefs ...\n" if $verbose;
@@ -692,6 +706,34 @@ sub time_str
return sprintf("[%.2d:%.2d:%.2d] ",$hour, $min, $sec);
}
+sub check_optional_step
+{
+ my $step = shift;
+ my $oconf;
+ my $shandle;
+
+ return undef unless ref ($oconf = $optional_steps->{$step});
+ if ($oconf->{branches})
+ {
+ return undef unless grep {$_ eq $branch} @{$oconf->{branches}};
+ }
+
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime(time);
+ return undef if (exists $oconf->{min_hour} && $hour < $oconf->{min_hour});
+ return undef if (exists $oconf->{max_hour} && $hour > $oconf->{max_hour});
+ return undef if (exists $oconf->{dow} &&
+ grep {$_ eq $wday} @{$oconf->{dow}});
+
+ my $last_step = $last_status = find_last("$step") || 0;
+
+ return undef unless (time >
+ $last_step + (3600 * $oconf->{min_hours_since}));
+ set_last("$step") unless $nostatus;
+
+ return 1;
+}
+
sub clean_from_source
{
if (-e "$pgsql/GNUmakefile")
@@ -761,6 +803,25 @@ sub make
$steps_completed .= " Make";
}
+sub make_doc
+{
+ return if $skip_steps{'make-doc'};
+ my (@makeout);
+ unless ($using_msvc)
+ {
+ @makeout = `cd $pgsql/doc && $make 2>&1`;
+ }
+ else
+ {
+ die "can't make docs under MSVC";
+ }
+ my $status = $? >>8;
+ writelog('make-doc',\@makeout);
+ print "======== make doc log ===========\n",@makeout if ($verbose > 1);
+ send_result('Doc',$status,\@makeout) if $status;
+ $steps_completed .= " Doc";
+}
+
sub make_install
{
my @makeout;
@@ -1107,6 +1168,58 @@ sub make_pl_install_check
if (grep {/pg_regress|Checking pl/} @checklog) ;
}
+sub make_isolation_check
+{
+ return if $skip_steps{'isolation-check'};
+ my @makeout;
+ unless ($using_msvc)
+ {
+ @makeout =
+ `cd $pgsql/src/test/isolation && $make NO_LOCALE=1 check 2>&1`;
+ }
+ else
+ {
+ chdir "$pgsql/src/tools/msvc";
+ @makeout = `perl vcregress.pl check 2>&1`;
+ chdir $branch_root;
+ }
+
+ my $status = $? >>8;
+
+ # get the log files and the regression diffs
+ my @logs = glob("$pgsql/src/test/isolation/log/*.log");
+ unshift(@logs,"$pgsql/src/test/isolation/regression.diffs")
+ if (-e "$pgsql/src/test/isolation/regression.diffs");
+ foreach my $logfile (@logs)
+ {
+ push(@makeout,"\n\n================== $logfile ===================\n");
+ my $handle;
+ open($handle,$logfile);
+ while(<$handle>)
+ {
+ push(@makeout,$_);
+ }
+ close($handle);
+ }
+ my $base = "$pgsql/src/test/isolation/tmp_check";
+ if ($status)
+ {
+ my @trace =
+ get_stack_trace("$base/install$installdir/bin", "$base/data");
+ push(@makeout,@trace);
+ }
+ else
+ {
+ rmtree($base);
+ }
+ writelog('isolation-check',\@makeout);
+ print "======== make isolation check logs ===========\n",@makeout
+ if ($verbose > 1);
+
+ send_result('IsolationCheck',$status,\@makeout) if $status;
+ $steps_completed .= " IsolationCheck";
+}
+
sub make_check
{
return if $skip_steps{check};
Please sign in to comment.
Something went wrong with that request. Please try again.