cros_run_unit_tests: Inclusive language changes.
Added --skip-packages to replace --package_blacklist.
Left --package_blacklist in place until usages confirmed removed.
BUG=chromium:1118472
TEST=run_pytest
Change-Id: I135d27c05171a71eba8303a58385c81850f7380b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2605430
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Stephane Belmon <sbelmon@google.com>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/scripts/cros_run_unit_tests.py b/scripts/cros_run_unit_tests.py
index f40f909..421411e 100644
--- a/scripts/cros_run_unit_tests.py
+++ b/scripts/cros_run_unit_tests.py
@@ -7,6 +7,7 @@
from __future__ import print_function
+import argparse
import multiprocessing
import os
import sys
@@ -52,11 +53,16 @@
'currently installed.')
parser.add_argument('--package_file', type='path',
help='Path to a file containing the list of packages '
- 'that should be tested.')
- parser.add_argument('--blacklist_packages', dest='package_blacklist',
- help='Space-separated list of blacklisted packages.')
+ 'that should be tested.')
parser.add_argument('--packages',
help='Space-separated list of packages to test.')
+ parser.add_argument('--blacklist_packages',
+ dest='skip_packages',
+ deprecated='Use --skip-packages instead.',
+ help=argparse.SUPPRESS)
+ parser.add_argument('--skip-packages',
+ help='Space-separated list of packages to NOT test even '
+ 'if they otherwise would have been tested.')
parser.add_argument('--nowithdebug', action='store_true',
help="Don't build the tests with USE=cros-debug")
parser.add_argument('--assume-empty-sysroot', default=False,
@@ -97,9 +103,9 @@
cros_build_lib.AssertInsideChroot()
sysroot = opts.sysroot or cros_build_lib.GetSysroot(opts.board)
- package_blacklist = set()
- if opts.package_blacklist:
- package_blacklist |= set(opts.package_blacklist.split())
+ skipped_packages = set()
+ if opts.skip_packages:
+ skipped_packages |= set(opts.skip_packages.split())
packages = set()
# The list of packages to test can be passed as a file containing a
@@ -123,10 +129,10 @@
workon_packages = set(workon.ListAtoms(use_all=True))
packages &= workon_packages
- for cp in packages & package_blacklist:
- logging.info('Skipping blacklisted package %s.', cp)
+ for cp in packages & skipped_packages:
+ logging.info('Skipping package %s.', cp)
- packages = packages - package_blacklist
+ packages = packages - skipped_packages
pkg_with_test = portage_util.PackagesWithTest(sysroot, packages)
if packages - pkg_with_test: