Fix a test ordering and state leak issues affecting tool/logging tests.

Review Request #12399 — Created June 21, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

Depending on the order in which tests were run, the new Tool conflict
tests in test_registry would fail. One failure had to do with the
presence or lack of Tool objects in the database, and the other had to
do with an assertLogs() failing to catch logged warnings.

There were three issues behind these. One was a failure in the test, and
two were state consistency issues:

  1. The new unit test needed Tool objects but failed to use the proper
    fixture. This wasn't caught initially due to the next issue.

  2. Tool objects were sometimes populated when not needed by a unit
    test, and could be populated at different levels of test setup,
    causing state inconsistency depending on which tests were run first.
    The solution to this is to avoid automatically populating Tool
    objects in SCMToolRegistry when running unit tests, allowing the
    previous fixture behavior to work as it did before, and to populate
    at the right times.

  3. A unit test in test_review.py globally disabled warnings. I can't
    determine why it did this, but it was likely for very old historical
    reasons. This affected subsequent tests. This code has now been
    removed.

Tested full test runs and various combinations of suites. All the ones
that failed before pass now.

Commits

Files

    Loading...