Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: tools/bots/functional_testing.py

Issue 310633003: Make the functional testing annotated steps script call the eggplant starting script (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 """ 7 """
8 Buildbot steps for functional testing master and slaves 8 Buildbot steps for functional testing master and slaves
9 """ 9 """
10 10
11 import os 11 import os
12 import re 12 import re
13 import shutil 13 import shutil
14 import sys 14 import sys
15 15
16 import bot 16 import bot
17 import bot_utils 17 import bot_utils
18 18
19 utils = bot_utils.GetUtils()
20
19 FT_BUILDER = r'ft-slave-(linux|mac)' 21 FT_BUILDER = r'ft-slave-(linux|mac)'
20 FT_MASTER = r'ft-master' 22 FT_MASTER = r'ft-master'
21 23
24 HOST_OS = utils.GuessOS()
25
22 EDITOR_LOCATION='/home/chrome-bot/Desktop' 26 EDITOR_LOCATION='/home/chrome-bot/Desktop'
23 27
24 def SrcConfig(name, is_buildbot): 28 def SrcConfig(name, is_buildbot):
25 """Returns info for the current buildbot based on the name of the builder. 29 """Returns info for the current buildbot based on the name of the builder.
26 30
27 - mode: always "release" 31 - mode: always "release"
28 - system: always "linux" or "mac" 32 - system: always "linux" or "mac"
29 """ 33 """
30 pattern = re.match(FT_BUILDER, name) 34 pattern = re.match(FT_BUILDER, name)
31 master_pattern = re.match(FT_MASTER, name) 35 master_pattern = re.match(FT_MASTER, name)
32 if not pattern and not master_pattern: 36 if not pattern and not master_pattern:
33 return None 37 return None
34 if master_pattern: 38 if master_pattern:
35 tag = 'master' 39 tag = 'master'
36 system = 'linux' 40 system = 'linux'
37 else: 41 else:
38 tag = 'slave' 42 tag = 'slave'
39 system = pattern.group(1) 43 system = pattern.group(1)
40 return bot.BuildInfo('none', 'none', 'release', system, 44 return bot.BuildInfo('none', 'none', 'release', system,
41 builder_tag=tag) 45 builder_tag=tag)
42 46
43 def Run(args): 47 def Run(args):
44 print "Running: %s" % ' '.join(args) 48 print "Running: %s" % ' '.join(args)
45 sys.stdout.flush() 49 sys.stdout.flush()
46 bot.RunProcess(args) 50 bot.RunProcess(args)
47 51
52 def FTSlave(config):
53 with bot.BuildStep('Fetching editor'):
54 revision = int(os.environ['BUILDBOT_GOT_REVISION'])
55 bot_name, _ = bot.GetBotName()
56 print bot_name
57 channel = bot_utils.GetChannelFromName(bot_name)
58 namer = bot_utils.GCSNamer(channel=channel)
59 system = config.system
60 if system == 'mac':
61 system = 'macos'
62 editor_path = namer.editor_zipfilepath(revision, system, 'x64')
63 gsutils = bot_utils.GSUtil()
64 local_path = os.path.join(EDITOR_LOCATION, 'editor.zip')
65 if os.path.exists(local_path):
66 os.remove(local_path)
67 local_extracted = os.path.join(EDITOR_LOCATION, 'dart')
68 shutil.rmtree(local_extracted, ignore_errors=True)
69 gsutils.execute(['cp', editor_path, local_path])
70 Run(['unzip', local_path, '-d', EDITOR_LOCATION])
71
72 def FTMaster(config):
73 run = int(os.environ['BUILDBOT_ANNOTATED_STEPS_RUN'])
74 with bot.BuildStep('Master run %s' % run):
75 if run == 1:
76 print 'Not doing anything on master before the triggers'
77 return
78 else:
79 builddir = os.path.join(bot_utils.DART_DIR,
80 utils.GetBuildDir(HOST_OS, HOST_OS),
81 'functional_testing')
82 shutil.rmtree(builddir, ignore_errors=True)
83 os.makedirs(builddir)
84 script_locations = os.path.join(bot_utils.DART_DIR, 'editor', 'ft')
85 Run(['/home/chrome-bot/func-test/bot-run', builddir, script_locations])
86
48 def FTSteps(config): 87 def FTSteps(config):
49 if config.builder_tag == 'master': 88 if config.builder_tag == 'master':
50 print 'Not doing anything on master for now' 89 FTMaster(config)
51 return 90 else:
52 revision = int(os.environ['BUILDBOT_GOT_REVISION']) 91 FTSlave(config)
53 bot_name, _ = bot.GetBotName() 92
54 print bot_name
55 channel = bot_utils.GetChannelFromName(bot_name)
56 namer = bot_utils.GCSNamer(channel=channel)
57 system = config.system
58 if system == 'mac':
59 system = 'macos'
60 editor_path = namer.editor_zipfilepath(revision, system, 'x64')
61 gsutils = bot_utils.GSUtil()
62 local_path = os.path.join(EDITOR_LOCATION, 'editor.zip')
63 if os.path.exists(local_path):
64 os.remove(local_path)
65 local_extracted = os.path.join(EDITOR_LOCATION, 'dart')
66 shutil.rmtree(local_extracted, ignore_errors=True)
67 gsutils.execute(['cp', editor_path, local_path])
68 Run(['unzip', local_path, '-d', EDITOR_LOCATION])
69
70 if __name__ == '__main__': 93 if __name__ == '__main__':
71 bot.RunBot(SrcConfig, FTSteps) 94 bot.RunBot(SrcConfig, FTSteps, build_step=None)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698