aboutsummaryrefslogtreecommitdiff
path: root/run_tests_for.py
AgeCommit message (Collapse)Author
2020-02-13toolchain-utils: migrate all in-use projects to python 3Zhizhou Yang
This patch migrates all in-use projects left to python 3. BUG=chromium:1011676 TEST=Passed unittests and launched scripts manually. Change-Id: I7f2de4e1131c05bacfac80667f3064da8adaebfd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2051397 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com>
2020-02-12toolchain-utils: Partially port scripts to python 3Zhizhou Yang
This patch ports some still-in-use python scripts under root directory of toolchain-utils to python 3. BUG=chromium:1011676 TEST=Passed unittests and tested with manually launching. Change-Id: Id6066944780a7204fe4746cd271f41ac20f2274d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2049103 Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2019-09-06run_tests_for: unbreak it on _unittest.py filesGeorge Burgess IV
I forgot to do `base +`, so files ending in _unittest.py weren't being properly detected + run. While I'm in the area, unittests should probably count as their own unittests. Quote style fixes are enforced by `cros lint`, so this fixes those, too. BUG=None TEST=Ran on a _unittest file and a file with a _unittest Change-Id: I7ef984afef2f66203f9d2236c3f5021aac5d9acf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1788666 Commit-Queue: George Burgess <gbiv@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2019-06-20Call go fmt, go lint, go test and go vetTobias Bosch
(via go test) during presubmit and git hooks. Will only warn when the go commands are not available as go is not part of depot_tools. BUG=chromium:976903 TEST=Tried with and without go/gofmt/golint in the path. TEST=Tried on go and non go files. TEST=Tried on go files with and without errors. Change-Id: I8a6aa4227f0d8649f7c390ab59f187f14955293c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1669745 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Tobias Bosch <tbosch@google.com> Tested-by: Tobias Bosch <tbosch@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
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>