| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, 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 Pub buildbot steps. | 8 Pub buildbot steps. |
| 9 | 9 |
| 10 Runs tests for pub and the pub packages that are hosted in the main Dart repo. | 10 Runs tests for pub and the pub packages that are hosted in the main Dart repo. |
| 11 """ | 11 """ |
| 12 | 12 |
| 13 import re | 13 import re |
| 14 import sys | 14 import sys |
| 15 | 15 |
| 16 import bot | 16 import bot |
| 17 | 17 |
| 18 PUB_BUILDER = r'pub-(linux|mac|win)(-russian)?' | 18 PUB_BUILDER = r'pub-(linux|mac|win)(-(russian))?' |
| 19 | 19 |
| 20 def PubConfig(name, is_buildbot): | 20 def PubConfig(name, is_buildbot): |
| 21 """Returns info for the current buildbot based on the name of the builder. | 21 """Returns info for the current buildbot based on the name of the builder. |
| 22 | 22 |
| 23 Currently, this is just: | 23 Currently, this is just: |
| 24 - mode: always "release" | 24 - mode: always "release" |
| 25 - system: "linux", "mac", or "win" | 25 - system: "linux", "mac", or "win" |
| 26 """ | 26 """ |
| 27 pub_pattern = re.match(PUB_BUILDER, name) | 27 pub_pattern = re.match(PUB_BUILDER, name) |
| 28 if not pub_pattern: | 28 if not pub_pattern: |
| 29 return None | 29 return None |
| 30 | 30 |
| 31 system = pub_pattern.group(1) | 31 system = pub_pattern.group(1) |
| 32 locale = pub_pattern.group(3) |
| 32 if system == 'win': system = 'windows' | 33 if system == 'win': system = 'windows' |
| 33 | 34 |
| 34 return bot.BuildInfo('none', 'vm', 'release', system, checked=True) | 35 return bot.BuildInfo('none', 'vm', 'release', system, checked=True, |
| 36 test_tag=locale) |
| 35 | 37 |
| 36 | 38 |
| 37 def PubSteps(build_info): | 39 def PubSteps(build_info): |
| 38 with bot.BuildStep('Build package-root'): | 40 with bot.BuildStep('Build package-root'): |
| 39 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, | 41 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, |
| 40 'packages'] | 42 'packages'] |
| 41 print 'Building package-root: %s' % (' '.join(args)) | 43 print 'Building package-root: %s' % (' '.join(args)) |
| 42 bot.RunProcess(args) | 44 bot.RunProcess(args) |
| 43 | 45 |
| 44 bot.RunTest('pub', build_info, ['--write-test-outcome-log', | 46 common_args = ['--write-test-outcome-log'] |
| 45 'pub', 'pkg', 'dartdoc', 'docs']) | 47 if build_info.test_tag: |
| 48 common_args.append('--test-tag=%s' % build_info.test_tag) |
| 49 |
| 50 bot.RunTest('pub', build_info, |
| 51 common_args + ['pub', 'pkg', 'dartdoc', 'docs']) |
| 46 | 52 |
| 47 pkgbuild_build_info = bot.BuildInfo('none', 'vm', 'release', | 53 pkgbuild_build_info = bot.BuildInfo('none', 'vm', 'release', |
| 48 build_info.system, checked=False) | 54 build_info.system, checked=False) |
| 49 bot.RunTest('pkgbuild_repo_pkgs', pkgbuild_build_info, | 55 bot.RunTest('pkgbuild_repo_pkgs', pkgbuild_build_info, |
| 50 ['--append_logs', '--write-test-outcome-log', | 56 common_args + ['--append_logs', '--use-repository-packages', 'pkgbuild']) |
| 51 '--use-repository-packages', 'pkgbuild']) | |
| 52 bot.RunTest('pkgbuild_public_pkgs', pkgbuild_build_info, | 57 bot.RunTest('pkgbuild_public_pkgs', pkgbuild_build_info, |
| 53 ['--append_logs', '--write-test-outcome-log', | 58 common_args + ['--append_logs', '--use-public-packages', 'pkgbuild']) |
| 54 '--use-public-packages', 'pkgbuild']) | |
| 55 | 59 |
| 56 if __name__ == '__main__': | 60 if __name__ == '__main__': |
| 57 bot.RunBot(PubConfig, PubSteps) | 61 bot.RunBot(PubConfig, PubSteps) |
| OLD | NEW |