Fish Trophy

chipx86 got a fish trophy!

Fish Trophy

Fix regressions in unit tests due to logging and missing test_scmtools.

Review Request #12421 — Created June 28, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

We've had a bit of churn recently with regard to the unit test
infrastructure for SCMTools and in-progress changes. Very temporarily,
unit tests could get away with not using the test_scmtools fixture,
but only as an artifact of state leakage. Recent landed changes
therefore passed at the time without this fixture, but is needed with it
now, since we still need a Tool object in the database and we only do
this if test_scmtools is added.

This change adds this missing fixture to all tests that make use of
repositories/SCMTools.

It also fixes two other test failures.

One was due to a copy/paste of a bad logging.disable() line in a new
test, a copy of the problem fixed in commit 9f51ffeb3. This was causing
test_registry to fail if run after the bad call.

The other was due to a unit test using assertQueries() that wasn't
updated for a change in Review accessibility checks. This has
uncovered a duplicate Q(public=True) that may be a problem,
particularly when trying to use Q(public=False). This needs to be
thoroughly investigated before we ship 5.0, in case there are security
implications.

And finally, it disables warnings in test runs due to the empty content
in test_scmtools by preventing Django from trying to load data from
this fixture in setUpClass().

All unit tests pass.

Commits

Files