OLD | NEW |
| (Empty) |
1 #!/usr/bin/python | |
2 | |
3 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
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. | |
6 | |
7 """ | |
8 Buildbot steps for stress testing analysis engine | |
9 """ | |
10 import os | |
11 import shutil | |
12 import sys | |
13 import bot | |
14 import bot_utils | |
15 | |
16 utils = bot_utils.GetUtils() | |
17 | |
18 def ServicesConfig(name, is_buildbot): | |
19 """Returns info for the current buildbot. | |
20 We only run this bot on linux, so all of this is just hard coded. | |
21 """ | |
22 return bot.BuildInfo('none', 'none', 'release', 'linux') | |
23 | |
24 def Run(args): | |
25 print "Running: %s" % ' '.join(args) | |
26 sys.stdout.flush() | |
27 bot.RunProcess(args) | |
28 | |
29 def ServicesSteps(build_info): | |
30 build_root = utils.GetBuildRoot('linux') | |
31 sdk_bin = utils.GetBuildSdkBin('linux', mode='release', arch='ia32') | |
32 dart_services = os.path.join('third_party', 'dart-services') | |
33 dart_services_copy = os.path.join(build_root, 'dart-services') | |
34 | |
35 with bot.BuildStep('Create copy of dart_services'): | |
36 print 'Removing existing copy of dart_services' | |
37 shutil.rmtree(dart_services_copy, ignore_errors=True) | |
38 args = ['cp', '-R', dart_services, dart_services_copy] | |
39 Run(args) | |
40 | |
41 with bot.BuildStep('Fixing pubspec file'): | |
42 pubspec = os.path.join(dart_services_copy, 'pubspec.yaml') | |
43 # TODO(lukechurch): Actually provide the name of the alternative pubspec | |
44 testing_pubspec = os.path.join(dart_services_copy, 'pubspec.foobar.yaml') | |
45 print 'Fixing pubspec up for stress testing' | |
46 # TODO(lukechurch): change to do the mv of the testing pubspec | |
47 Run(['ls', pubspec]) | |
48 | |
49 with bot.BuildStep('Run pub'): | |
50 print 'Print running pub' | |
51 pub = os.path.join(sdk_bin, 'pub') | |
52 with utils.ChangedWorkingDirectory(dart_services_copy): | |
53 args = [pub, 'get'] | |
54 | |
55 with bot.BuildStep('Stress testing'): | |
56 # Consider doing something more useful here. | |
57 args = ['ls', 'third_party'] | |
58 Run(args) | |
59 | |
60 | |
61 if __name__ == '__main__': | |
62 bot.RunBot(ServicesConfig, ServicesSteps) | |
63 | |
OLD | NEW |