Commit 058cdee9 authored by Leif Walsh's avatar Leif Walsh

update stress test runner for git

parent bbd589f2
...@@ -10,7 +10,7 @@ Suitable for running on a dev branch, or a release branch, or main. ...@@ -10,7 +10,7 @@ Suitable for running on a dev branch, or a release branch, or main.
Just run the script from within a branch you want to test. Just run the script from within a branch you want to test.
By default, we stop everything, update from svn, rebuild, and restart the By default, we stop everything, update from git, rebuild, and restart the
tests once a day. tests once a day.
""" """
...@@ -495,7 +495,7 @@ The test was upgrading from %s.''' % runner.oldversionstr ...@@ -495,7 +495,7 @@ The test was upgrading from %s.''' % runner.oldversionstr
upgradestr = '' upgradestr = ''
send_mail(self.email, send_mail(self.email,
'Stress test failure on %(hostname)s running %(branch)s.' % { 'hostname': h, 'branch': self.branch }, 'Stress test failure on %(hostname)s running %(branch)s.' % { 'hostname': h, 'branch': self.branch },
('''A stress test failed on %(hostname)s running %(branch)s at svn revision %(rev)s after %(test_duration)d seconds.%(upgradestr)s ('''A stress test failed on %(hostname)s running %(branch)s at revision %(rev)s after %(test_duration)d seconds.%(upgradestr)s
Its environment is saved to %(tarfile)s on that machine. Its environment is saved to %(tarfile)s on that machine.
The test configuration was: The test configuration was:
...@@ -537,11 +537,13 @@ def send_mail(toaddrs, subject, body): ...@@ -537,11 +537,13 @@ def send_mail(toaddrs, subject, body):
s.sendmail(fromaddr, toaddrs, str(m)) s.sendmail(fromaddr, toaddrs, str(m))
s.quit() s.quit()
def rebuild(tokudb, builddir, toku_svnroot, cc, cxx, tests): def update(tokudb):
info('Updating from svn.') info('Updating from git.')
devnull = open(os.devnull, 'w') devnull = open(os.devnull, 'w')
call(['svn', 'up'], stdout=devnull, stderr=STDOUT, cwd=tokudb) call(['git', 'pull'], stdout=devnull, stderr=STDOUT, cwd=tokudb)
devnull.close() devnull.close()
def rebuild(tokudb, builddir, tokudb_data, cc, cxx, tests):
info('Building tokudb.') info('Building tokudb.')
if not os.path.exists(builddir): if not os.path.exists(builddir):
os.mkdir(builddir) os.mkdir(builddir)
...@@ -555,7 +557,7 @@ def rebuild(tokudb, builddir, toku_svnroot, cc, cxx, tests): ...@@ -555,7 +557,7 @@ def rebuild(tokudb, builddir, toku_svnroot, cc, cxx, tests):
'-DUSE_CTAGS=OFF', '-DUSE_CTAGS=OFF',
'-DUSE_ETAGS=OFF', '-DUSE_ETAGS=OFF',
'-DUSE_CSCOPE=OFF', '-DUSE_CSCOPE=OFF',
'-DTOKU_SVNROOT=%s' % toku_svnroot, '-DTOKUDB_DATA=%s' % tokudb_data,
tokudb], tokudb],
env=newenv, env=newenv,
cwd=builddir) cwd=builddir)
...@@ -570,7 +572,7 @@ def rebuild(tokudb, builddir, toku_svnroot, cc, cxx, tests): ...@@ -570,7 +572,7 @@ def rebuild(tokudb, builddir, toku_svnroot, cc, cxx, tests):
sys.exit(r) sys.exit(r)
def revfor(tokudb): def revfor(tokudb):
proc = Popen("svn info | awk '/Revision/ {print $2}'", proc = Popen("git describe --tags",
shell=True, cwd=tokudb, stdout=PIPE) shell=True, cwd=tokudb, stdout=PIPE)
(out, err) = proc.communicate() (out, err) = proc.communicate()
rev = out.strip() rev = out.strip()
...@@ -580,7 +582,7 @@ def revfor(tokudb): ...@@ -580,7 +582,7 @@ def revfor(tokudb):
def main(opts): def main(opts):
builddir = os.path.join(opts.tokudb, 'build') builddir = os.path.join(opts.tokudb, 'build')
if opts.build: if opts.build:
rebuild(opts.tokudb, builddir, opts.toku_svnroot, opts.cc, opts.cxx, opts.testnames + opts.recover_testnames) rebuild(opts.tokudb, builddir, opts.tokudb_data, opts.cc, opts.cxx, opts.testnames + opts.recover_testnames)
rev = revfor(opts.tokudb) rev = revfor(opts.tokudb)
if not os.path.exists(opts.savedir): if not os.path.exists(opts.savedir):
...@@ -668,7 +670,8 @@ def main(opts): ...@@ -668,7 +670,8 @@ def main(opts):
if scheduler.error is not None: if scheduler.error is not None:
error('Scheduler reported an error.') error('Scheduler reported an error.')
raise scheduler.error raise scheduler.error
rebuild(opts.tokudb, builddir, opts.toku_svnroot, opts.cc, opts.cxx, opts.testnames + opts.recover_testnames) update(opts.tokudb)
rebuild(opts.tokudb, builddir, opts.tokudb_data, opts.cc, opts.cxx, opts.testnames + opts.recover_testnames)
rev = revfor(opts.tokudb) rev = revfor(opts.tokudb)
for runner in runners: for runner in runners:
runner.rev = rev runner.rev = rev
...@@ -739,12 +742,12 @@ if __name__ == '__main__': ...@@ -739,12 +742,12 @@ if __name__ == '__main__':
'recover-test_stress_openclose.tdb'] 'recover-test_stress_openclose.tdb']
build_group = OptionGroup(parser, 'Build Options', 'Control how the fractal tree and tests get built.') build_group = OptionGroup(parser, 'Build Options', 'Control how the fractal tree and tests get built.')
build_group.add_option('--skip_build', action='store_false', dest='build', default=True, build_group.add_option('--skip_build', action='store_false', dest='build', default=True,
help='skip the svn up and build phase before testing [default=False]') help='skip the git pull and build phase before testing [default=False]')
build_group.add_option('--rebuild_period', type='int', dest='rebuild_period', default=60 * 60 * 24, build_group.add_option('--rebuild_period', type='int', dest='rebuild_period', default=60 * 60 * 24,
help='how many seconds between doing an svn up and rebuild, 0 means never rebuild [default=24 hours]') help='how many seconds between doing an git pull and rebuild, 0 means never rebuild [default=24 hours]')
default_toku_svnroot = os.path.abspath(os.path.join(default_toplevel, '..', '..')) default_tokudb_data = os.path.abspath(os.path.join(default_toplevel, '..', 'tokudb.data'))
build_group.add_option('--toku_svnroot', type='string', dest='toku_svnroot', default=default_toku_svnroot, build_group.add_option('--tokudb_data', type='string', dest='tokudb_data', default=default_tokudb_data,
help='passed to cmake as TOKU_SVNROOT [default=%s]' % default_toku_svnroot) help='passed to cmake as TOKUDB_DATA [default=%s]' % default_tokudb_data)
build_group.add_option('--cc', type='string', dest='cc', default='gcc47', build_group.add_option('--cc', type='string', dest='cc', default='gcc47',
help='which compiler to use [default=gcc47]') help='which compiler to use [default=gcc47]')
build_group.add_option('--cxx', type='string', dest='cxx', default='g++47', build_group.add_option('--cxx', type='string', dest='cxx', default='g++47',
...@@ -765,7 +768,7 @@ if __name__ == '__main__': ...@@ -765,7 +768,7 @@ if __name__ == '__main__':
upgrade_group.add_option('--add_old_version', action='append', type='choice', dest='old_versions', choices=['4.2.0', '5.0.8', '5.2.7', '6.0.0', '6.1.0', '6.5.1', '6.6.3'], upgrade_group.add_option('--add_old_version', action='append', type='choice', dest='old_versions', choices=['4.2.0', '5.0.8', '5.2.7', '6.0.0', '6.1.0', '6.5.1', '6.6.3'],
help='which old versions to use for running the stress tests in upgrade mode. can be specified multiple times [options=4.2.0, 5.0.8, 5.2.7, 6.0.0, 6.1.0, 6.5.1, 6.6.3]') help='which old versions to use for running the stress tests in upgrade mode. can be specified multiple times [options=4.2.0, 5.0.8, 5.2.7, 6.0.0, 6.1.0, 6.5.1, 6.6.3]')
upgrade_group.add_option('--old_environments_dir', type='string', dest='old_environments_dir', upgrade_group.add_option('--old_environments_dir', type='string', dest='old_environments_dir',
default='../../tokudb.data/old-stress-test-envs', default=('%s/old-stress-test-envs' % default_tokudb_data),
help='directory containing old version environments (should contain 5.0.8/, 5.2.7/, etc, and the environments should be in those) [default=../../tokudb.data/stress_environments]') help='directory containing old version environments (should contain 5.0.8/, 5.2.7/, etc, and the environments should be in those) [default=../../tokudb.data/stress_environments]')
parser.add_option_group(upgrade_group) parser.add_option_group(upgrade_group)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment