Fix using the preconfigured test_packages in the test runner.

Review Request #8658 — Created Jan. 21, 2017 and submitted

Information

Djblets
release-0.8.x
d2ac023...

Reviewers

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 the test_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 configured test_packages if empty.

Tested with RBCommons, which separates out the rbcommons tests from
the reviewboard tests using test_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.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/testing/testrunners.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/testing/testrunners.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.8.x (4b3142c)