My favourite use of the VM we have at ASF: [[[ # curl -o foo.diff http://article.gmane.org/gmane.comp.version-control.subversion.devel/126999/raw % cat foo.diff | ssh svn-qavm.a.o ./check $nickname % sleep 720 % head -1 INBOX Date: Mon, 04 Apr 2011 09:45:56 +0000 From: [email protected] To: [email protected] Subject: ./check@svn-qavm: $nickname: done: 20110404-09:33:52 Message-Id: <[email protected]>
make: *** [check] Error 1 URL: https://svn.apache.org/repos/asf/subversion/trunk Revision: 1088524 patching file subversion/libsvn_client/merge.c Hunk #3 succeeded at 8702 (offset 21 lines). Running tests in svnadmin_tests.py [73/88]....................FAILURE Running tests in tree_conflict_tests.py [81/88]...............FAILURE At least one test XPASSED, checking /home/danielsh/src/svn/patches/tests.log XPASS: tree_conflict_tests.py 22: tree conflict at directory external At least one test FAILED, checking /home/danielsh/src/svn/patches/tests.log FAIL: svnadmin_tests.py 17: fsfs recovery checks missing revs / revprops files Summary of test results: 1439 tests PASSED 41 tests SKIPPED 49 tests XFAILED (2 WORK-IN-PROGRESS) 1 test XPASSED 1 test FAILED ]]] Does a complete checkout/autogen/configure/make/'make check', saves the full patch (including log message that patch(1) ignored) and tests output aside, and mails me the highlights of the results (including compiler warnings if any). And faster than my local machine, too :)
#!/usr/bin/perl
# TODO: make 'svnserve -T' check
# TODO: clean up old src/svn/patches.* dirs
chdir or die;
use POSIX qw/strftime/;
# what goes where
my $nick = shift || "\$nick";
my $unique = "$$.$nick";
my $patchfile = "$ENV{HOME}/check.d/patch.$unique";
my $logfile = "$ENV{HOME}/check.d/log.$unique";
my $hostname = `hostname`; chomp $hostname;
my $starttime = strftime "%Y%m%d-%H:%M:%S", localtime;
my $whoami = (getpwuid $>)[0];
# save stdin before forking
system("cat > $patchfile") == 0 or die;
# daemonize
my $pid = fork;
die "fork: $!" unless defined $pid;
exit if $pid;
close STDIN and close STDOUT and close STDERR or die $!;
# in child
open STDOUT, '|-', qw/mail -s/, "$0\@$hostname: $nick: done: $starttime",
$whoami or die;
open STDERR, ">&STDOUT" or die;
open STDIN, "/bin/sh check.sh $patchfile $logfile $unique 2>&1 |" or die $!;
print while <STDIN>;
check.sh
Description: Bourne shell script

