| Index: tools/bots/functional_testing.py
|
| ===================================================================
|
| --- tools/bots/functional_testing.py (revision 36728)
|
| +++ tools/bots/functional_testing.py (working copy)
|
| @@ -8,5 +8,52 @@
|
| Buildbot steps for functional testing master and slaves
|
| """
|
|
|
| +import os
|
| +import re
|
| +import shutil
|
| +import sys
|
| +
|
| +import bot
|
| +import bot_utils
|
| +
|
| +FT_BUILDER = r'ft-slave-(linux|mac)'
|
| +
|
| +EDITOR_LOCATION='/home/chrome-bot/Desktop'
|
| +
|
| +def SrcConfig(name, is_buildbot):
|
| + """Returns info for the current buildbot based on the name of the builder.
|
| +
|
| + - mode: always "release"
|
| + - system: always "linux" or "mac"
|
| + """
|
| + pattern = re.match(FT_BUILDER, name)
|
| + if not pattern:
|
| + return None
|
| + return bot.BuildInfo('none', 'none', 'release', pattern.group(1))
|
| +
|
| +def Run(args):
|
| + print "Running: %s" % ' '.join(args)
|
| + sys.stdout.flush()
|
| + bot.RunProcess(args)
|
| +
|
| +def FTSteps(config):
|
| + revision = int(os.environ['BUILDBOT_GOT_REVISION'])
|
| + bot_name, _ = bot.GetBotName()
|
| + print bot_name
|
| + channel = bot_utils.GetChannelFromName(bot_name)
|
| + namer = bot_utils.GCSNamer(channel=channel)
|
| + system = config.system
|
| + if system == 'mac':
|
| + system = 'macos'
|
| + editor_path = namer.editor_zipfilepath(revision, system, 'x64')
|
| + gsutils = bot_utils.GSUtil()
|
| + local_path = os.path.join(EDITOR_LOCATION, 'editor.zip')
|
| + if os.path.exists(local_path):
|
| + os.remove(local_path)
|
| + local_extracted = os.path.join(EDITOR_LOCATION, 'dart')
|
| + shutil.rmtree(local_extracted, ignore_errors=True)
|
| + gsutils.execute(['cp', editor_path, local_path])
|
| + Run(['unzip', local_path, '-d', EDITOR_LOCATION])
|
| +
|
| if __name__ == '__main__':
|
| - print "Functional testing placeholder"
|
| + bot.RunBot(SrcConfig, FTSteps)
|
|
|