Fix a test ordering and state leak issues affecting tool/logging tests.
Review Request #12399 — Created June 21, 2022 and submitted — Latest diff uploaded
Depending on the order in which tests were run, the new
Tool
conflict
tests intest_registry
would fail. One failure had to do with the
presence or lack ofTool
objects in the database, and the other had to
do with anassertLogs()
failing to catch logged warnings.There were three issues behind these. One was a failure in the test, and
two were state consistency issues:
The new unit test needed
Tool
objects but failed to use the proper
fixture. This wasn't caught initially due to the next issue.
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 populatingTool
objects inSCMToolRegistry
when running unit tests, allowing the
previous fixture behavior to work as it did before, and to populate
at the right times.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.