These changes will make it easier to introduce tests for alternate databases that may have different results without the need to duplicate lots of the tests definition. Backport of 5873f10177 from main.
5873f10177