Problem/Motivation
This code in WorkAllocator
private function getTestTypeWeight(string $class): int {
assert(class_exists($class), "$class does not exist");
return match(TRUE) {
is_subclass_of($class, WebDriverTestBase::class) => 3,
is_subclass_of($class, BrowserTestBase::class) => 2,
is_subclass_of($class, BuildTestBase::class) => 2,
is_subclass_of($class, KernelTestBase::class) => 1,
default => 0,
};
}
makes it hard to unit test it with fixtures, because fixture is dependent on the existence of the test class.
Proposed resolution
Rely on the determination done in PhpUnitTestDiscovery instead of checking existence and inheritance in WorkAllocator.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #2
mondrakeComment #4
mondrakeComment #5
mondrakeD12 eligible only, as the MR uses the native PHPUnit testsuite names, that are not supported in 11.x
Comment #6
smustgrave commentedGoing off the eye test here as wasn't sure how to test, but the change to getTestTypeWeight makes sense and tests appear to run. Going to mark but if more I should test let me know.
Since this is major only maybe we try it out on main for a bit?
Comment #10
catchCommitted/pushed to main and 11.x, thanks!
Comment #12
mondrakeimo the 11.x commit should be reverted - this issue is built over #3581399: Stop using legacy names for test suites that was only committed to main.
edit - alternatively the related could be backported (maybe, haven’t checked)
Comment #14
catchReverted the 11.x commit, let's leave this fixed on main for now.