Files
sdk/tools/bots/pub.py
T
Nate Bosch 55f81f2210 Mass format python with yapf
- Add `.style.yapf` with configuration to use Google style.
- Run `yapf` on all `.py` files in this repo.
- Manually fix one trailing space in a doc string.
- Run `git cl format runtime` to satisfy presubmit.

Change-Id: I7e6bd11e91f07926b9188362599af398551eed79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111600
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-08-05 20:34:31 +00:00

51 lines
1.3 KiB
Python
Executable File

#!/usr/bin/python
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""
Pub buildbot steps.
Runs tests for pub and the pub packages that are hosted in the main Dart repo.
"""
import os
import re
import bot
PUB_BUILDER = r'pub-(linux|mac|win)'
def PubConfig(name, is_buildbot):
"""Returns info for the current buildbot based on the name of the builder.
Currently, this is just:
- mode: always release, we don't run pub in debug mode
- system: "linux", "mac", or "win"
- checked: always true
"""
pub_pattern = re.match(PUB_BUILDER, name)
if not pub_pattern:
return None
system = pub_pattern.group(1)
mode = 'release'
if system == 'win': system = 'windows'
return bot.BuildInfo('none', 'vm', mode, system, checked=True, arch='x64')
def PubSteps(build_info):
pub_location = os.path.join('third_party', 'pkg', 'pub')
with bot.BuildStep('Running pub tests'):
bot.RunTestRunner(build_info, pub_location)
dartdoc_location = os.path.join('third_party', 'pkg', 'dartdoc')
with bot.BuildStep('Running dartdoc tests'):
bot.RunTestRunner(build_info, dartdoc_location)
if __name__ == '__main__':
bot.RunBot(PubConfig, PubSteps)