Fix using the preconfigured test_packages in the test runner.
Review Request #8658 — Created Jan. 21, 2017 and submitted
The test runner tries to respect the
test_packages
variable defined on
the test runner, to allow only a subset of tests to run by default.
However, this was broken, as we trusted thetest_labels
variable
provided to us, but this could easily support options masquerading as
test labels.We now filter those test labels, removing anything that looks like an
option or is already specified in the nose arguments. Since those nose
arguments are built based on command line arguments, this should safely
remove everything but the test labels we want to run, and fall back on
the configuredtest_packages
if empty.
Tested with RBCommons, which separates out the rbcommons tests from
the reviewboard tests usingtest_packages
. When passing command
line arguments (like-x
),test_packages
was being ignored, but
now it's working fine and correctly using-x
.Tested standard test runs of Djblets and Review Board.