For Mutant's phpunit.xml, set executionOrder="default"
to prevent random ordering of the tests since we need them to be sorted (fastest - first)
#1547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During the work on #1519, found that we have a critical bug. We always said we run the tests from fastest to slowest, hoping that the fastest tests fail first. It's true, unless the original
phpunit.xml
has anexecutionOrder=random
attribute set (closest example - Infection's test suite itself).When Infection builds Mutant's
phpunit.xml
file, we add<file>
tags, sorted by tests execution time, so that the fastest tests runs first.But when the original
phpunit.xml
containsexecutionOrder="random"
, it was inherited to Mutant'sphpunit.xml
and broke the order, running the tests in a random order each timeinfection
was executed.This also explains why I got different execution time of Infection for the project with slow functional tests (there is the same issue for unit tests, but they are fast enough so this issue is not visible).
When Mutant is covered by 1000 functional tests, and tests are executed by random, it can be killed by the first test in run
#1
and can be killed by 1000-th test in run#2
, if the killing test is executed the last.With this update, all the tests will be executed in the same orders (fastest - first) in all the infection runs.
For more clarity, this is what happens in
master
right now with executing the same command 2 times:#1
run:#2
run:^ you can see that tests were executed in a random order, and the killing test was 499th in the
#1
run, and 245th in the#2
run