Re: [alvherre@2ndquadrant.com: Re: no test programs in contrib] - Mailing list pgsql-hackers
From | Alvaro Herrera |
---|---|
Subject | Re: [alvherre@2ndquadrant.com: Re: no test programs in contrib] |
Date | |
Msg-id | 20141216143130.GC20615@alvh.no-ip.org Whole thread Raw |
Responses |
Re: [alvherre@2ndquadrant.com: Re: no test programs in
contrib]
|
List | pgsql-hackers |
Hi Andrew, Did you have a chance to review this? Alvaro Herrera wrote: > Andrew Dunstan wrote: > > > > On 11/29/2014 10:09 PM, Alvaro Herrera wrote: > > >Anyway I just pushed this src/test/modules/ patch, which has > > >implications for buildfarm: these new test modules are not invoked > > >except explicitely. How would go about getting members to run "cd > > >src/test/modules ; make check ; make installcheck"? I imagine it's > > >impossible to do it unless each member maintainer update the buildfarm > > >client script, right? > > > > Yes. > > > > Why are we going to run both check and installcheck? And what output files > > are created? The buildfarm will need to know. > > Well, initially the patch moved test_decoding to src/test/modules, which > requires make check, but I left that in contrib due to complaints, and > all remaining modules are happy to use make installcheck. Attached is a > patch to run_build.pl that adds src/test/modules build, install and > check. I also added the vcregress call (just copied it from the contrib > one, really), but of course that doesn't work at all yet since MSVC > doesn't build it. Would you give it a look? I would like to have > buildfarm doing this before moving on with more stuff. > diff --git a/run_build.pl b/run_build.pl > index a358d9c..77fcf62 100755 > --- a/run_build.pl > +++ b/run_build.pl > @@ -665,6 +665,8 @@ make_bin_check(); > # contrib is builtunder standard build step for msvc > make_contrib() unless ($using_msvc); > > +make_testmodules(); > + > make_doc() if (check_optional_step('build_docs')); > > make_install(); > @@ -672,6 +674,8 @@ make_install(); > # contrib is installed under standard install for msvc > make_contrib_install() unless ($using_msvc); > > +make_testmodules_install(); > + > process_module_hooks('configure'); > > process_module_hooks('build'); > @@ -753,6 +757,19 @@ foreach my $locale (@locales) > make_contrib_install_check($locale); > } > > + if (step_wanted('testmodules-install-check')) > + { > + print time_str(),"restarting db ($locale)...\n" if $verbose; > + > + stop_db($locale); > + start_db($locale); > + > + print time_str(),"running make test-modules installcheck ($locale)...\n" > + if $verbose; > + > + make_testmodules_install_check($locale); > + } > + > print time_str(),"stopping db ($locale)...\n" if $verbose; > > stop_db($locale); > @@ -1062,6 +1079,22 @@ sub make_contrib > $steps_completed .= " Contrib"; > } > > +sub make_testmodules > +{ > + return unless step_wanted('testmodules'); > + print time_str(),"running make src/test/modules ...\n" if $verbose; > + > + my $make_cmd = $make; > + $make_cmd = "$make -j $make_jobs" > + if ($make_jobs > 1 && ($branch eq 'HEAD' || $branch ge 'REL9_1')); > + my @makeout = `cd $pgsql/src/test/modules && $make_cmd 2>&1`; > + my $status = $? >> 8; > + writelog('make-testmodules',\@makeout); > + print "======== make testmodules log ===========\n",@makeout if ($verbose > 1); > + send_result('TestModules',$status,\@makeout) if $status; > + $steps_completed .= " TestModules"; > +} > + > sub make_contrib_install > { > return > @@ -1081,6 +1114,23 @@ sub make_contrib_install > $steps_completed .= " ContribInstall"; > } > > +sub make_testmodules_install > +{ > + return > + unless (step_wanted('testmodules') > + and step_wanted('install')); > + print time_str(),"running make testmodules install ...\n" > + if $verbose; > + > + my @makeout = `cd $pgsql/src/test/modules && $make install 2>&1`; > + my $status = $? >>8; > + writelog('install-testmodules',\@makeout); > + print "======== make testmodules install log ===========\n",@makeout > + if ($verbose > 1); > + send_result('TestModulesInstall',$status,\@makeout) if $status; > + $steps_completed .= " TestModulesInstall"; > +} > + > sub initdb > { > my $locale = shift; > @@ -1317,6 +1367,50 @@ sub make_contrib_install_check > $steps_completed .= " ContribCheck-$locale"; > } > > +sub make_testmodules_install_check > +{ > + my $locale = shift; > + return unless step_wanted('testmodules-install-check'); > + my @checklog; > + unless ($using_msvc) > + { > + @checklog = > + `cd $pgsql/src/test/modules && $make USE_MODULE_DB=1 installcheck 2>&1`; > + } > + else > + { > + chdir "$pgsql/src/tools/msvc"; > + @checklog = `perl vcregress.pl modulescheck 2>&1`; > + chdir $branch_root; > + } > + my $status = $? >>8; > + my @logs = glob("$pgsql/src/test/modules/*/regression.diffs"); > + push(@logs,"$installdir/logfile"); > + foreach my $logfile (@logs) > + { > + next unless (-e $logfile); > + push(@checklog,"\n\n================= $logfile ===================\n"); > + my $handle; > + open($handle,$logfile); > + while(<$handle>) > + { > + push(@checklog,$_); > + } > + close($handle); > + } > + if ($status) > + { > + my @trace = > + get_stack_trace("$installdir/bin","$installdir/data"); > + push(@checklog,@trace); > + } > + writelog("testmodules-install-check-$locale",\@checklog); > + print "======== make testmodules installcheck log ===========\n",@checklog > + if ($verbose > 1); > + send_result("TestModulesCheck-$locale",$status,\@checklog) if $status; > + $steps_completed .= " TestModulesCheck-$locale"; > +} > + > sub make_pl_install_check > { > my $locale = shift; -- Álvaro Herrera http://www.flickr.com/photos/alvherre/ "Ah, spring... when a young penguin's fancy lightly turns to thoughts of ... Beta testing!" (Fedora 9 beta announcement)
pgsql-hackers by date: