From 3a846cdbc86fa4b8ac0b1bd8c4fdf0d63fb77575 Mon Sep 17 00:00:00 2001 From: Kaiyi Li Date: Wed, 20 Sep 2023 17:07:50 -0700 Subject: [PATCH] tools: fix unit test filter The TestFilter.exclude and TestFilter.include methods won't mutate the test filter. They return new test filter object instead. Therefore, the old code leaves the unit test filter unmodified by mistake. Test: ./tools/dev_container tools/presubmit crosvm_tests_mingw64 and see filter generated Change-Id: Ib760665ead5b5fa7a141dc96426ce63b2645a808 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4881277 Reviewed-by: Daniel Verkamp Reviewed-by: Zihan Chen Commit-Queue: Kaiyi Li --- tools/run_tests | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/run_tests b/tools/run_tests index bd5128bc0a..5c64004b56 100755 --- a/tools/run_tests +++ b/tools/run_tests @@ -336,9 +336,7 @@ def main( sys.exit(returncode) if not no_unit_tests: - unit_test_filter = copy.deepcopy(test_filter) - unit_test_filter.include("kind(bench)") - unit_test_filter.exclude(*E2E_TESTS) + unit_test_filter = copy.deepcopy(test_filter).exclude(*E2E_TESTS).include("kind(bench)") console.print() console.rule("Running unit tests") with record_time("Unit Tests"):