aboutsummaryrefslogtreecommitdiff
path: root/.style.yapf
AgeCommit message (Collapse)Author
2019-03-16[githooks] Add a test runnerGeorge Burgess IV
This CL adds a test-runner as ./run_tests_for.py. This can manually be invoked pretty easily; just hand it a few files, and it'll try to figure out what tests need to be run for that. If it finds any tests, they'll be run in parallel. This includes an incidental update to our yapf style, per reviewer comments. The intent is to use this script to run tests as part of a `repo upload` hook. Test discovery is kind of haphazard, and split into two phases. Basically, there's a set of directories where if you touch anything in that directory, all tests in that directory get run (see `_find_forced_subdir_tests`). Otherwise, this script just tries to find names of files similar to the ones it's given, but with _test/_unittest in them. I chose this method of discovery since `foo_unittest.py` and `foo_test.py` appear to be the two prevalent naming conventions here, and no one wants to keep a text file (or similar) up-to-date with all of the tests that exist. At the moment, this only supports Python. Adding support for auto-detecting other tests should hopefully be straightforward enough, if we want to add it. BUG=None TEST=Ran crosperf's tests. Observed failures. Change-Id: Ieeb3e5ad25011c6ef2f93908b051c4da1e776350 Reviewed-on: https://chromium-review.googlesource.com/1516414 Commit-Ready: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org>
2019-01-04toolchain-utils: add a top-level `yapf` fileGeorge Burgess IV
yapf is a Python autoformatter, much like how clang-tidy is an autoformatter for c/c++. It's available by default in the chroot, and appears to be in use by our autotest friends. I ran `yapf -i *.py`, and it only suggested a handful of changes from our current style here. The only one I really noticed was that it preferred 'foo %s' % (really_long_variable_name_one, really_long_variable_name_two) over 'foo %s' % (really_long_variable_name_one, really_long_variable_name_two) ...Which I think we do in some files, anyway. This file magically applies to all `yapf` invocations inside of toolchain-utils, so it's not something that people need to worry about. Simply run `yapf -i file.py`, and it'll be automatically formatted to conform to Chromium's style guidelines, which we try to follow here. BUG=chromium:918755 TEST=`yapf *.py` left files mostly untouched. `cros lint` is just as (un)happy after the format as it was before. Change-Id: Ie09694d8466b398ca07f5c8544597c9a28c7abfe Reviewed-on: https://chromium-review.googlesource.com/1392445 Commit-Ready: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Luis Lozano <llozano@chromium.org>