Move execution reordering to main iterator #4302
Labels
feature/test-runner
CLI test runner
type/refactoring
A refactoring that should be applied to make the code easier to understand and maintain
Move all existing test execution reordering functionality to the code that answers the question what test shall we run next?
This refactoring is a continuation of the work for the recent
@depends
improvements and does not change anything for the end-users. The deliverable is a small pull request with@internal
clean up.Why
Folding the existing reordering mechanism into the core iterator and cleaning up the supporting code has tangible benefits:
@dataProvider
tests are loaded.TestSuiteSorter
sorts the internal tests graph which can have side-effects. In contrast the extended iterator will simply loop over the existing tree in a different order. This makes it more flexible and robust.@dataProvider
tests with properrewind
/next
hooks.TestSuiteSorter
has too much knowledge of the runner internals.To do
interface
for tests that implement the requirements for the PHPUnit@depends
-resolverReorderableTest
(name suggestions welcome!)getInternalId()
for all PHPUnit test objectsprovides-requires
dependency resolver for all reordarable test typesTestSuiteIterator
for all test iterationTestSuite
duringIterator::rewind()
Iterator::next()
--filter
mechanism)TestSuiteSorter
as the main reordering mechanismTestSuiteSorter
comparators for sorting individualTestSuite
smove test graph traversal for calculation original execution orderutility function fits heregetSorterUID
in favour of new interfaceTestSuite[Iterator|Sorter]
a good washThe text was updated successfully, but these errors were encountered: