![]() If build/coverage path is provided, it should contain phpspec-coverage-xml folder.Infection requires the xml report to work.If build/coverage path is provided, it should contain coverage-xml folder and junit.xml file.Infection requires both the xml and junit reports to work.With this option it’s possible to reuse already generated coverage in Infection. This dramatically increases the build time because running your tests with debugger twice requires too much time. ![]() Then, you run Infection for mutation testing, which in its turn, generates Code Coverage again for internal needs. When you use Continuous Integration for your project, probably you are already generating code coverage metrics and run PHPUnit with Xdebug/ phpdbg enabled. Applying -filter or -testsuite would not make sense in this context as the tests have already been filtered down. Each mutation has a custom phpunit.xml file generated for it which defines a single testsuite containing the tests which should be executed for that mutation. Please note that if you choose to use -configuration, -filter, or -testsuite for PHPUnit, these options will only be applied to the initial test run. This will execute the PHPUnit as: phpunit -verbose -filter=just/unit/tests Example for PHPUnit: infection.phar - test-framework-options= "-verbose -filter=just/unit/tests" This option allows passing additional options to the test framework. PHAR distribution is bundled with all available adapters.įeel free to request a new test framework to be supported out of the box in Github’s issues. Other test framework adapters will be automatically installed on demand. If you are using infection/infection Composer package, PHPUnit and Pest are installed by default. Currently, Infection supports PHPUnit, PhpSpec, Pest and Codeception. This is a name of the Test Framework to use. Consider benchmarking several numbers to find one that works best for your particular case. Running Infection with more threads not necessarily leads to better performance. To automatically detect the number of CPU cores, use -threads=max.įor Infection versions below 0.26.15, you can detect the number of CPU cores depending on OS: # on Linux Please note that if your tests somehow depends on each other or use database, this option can lead to failing tests which give many false-positives results. It will dramatically speed up mutation process. If you want to run tests for mutated code in parallel, set this to something > 1. This in no way restricts the initial Infection check on the overall test suite which is still executed in full to ensure all tests are passing correctly before proceeding. If you’re only interested in mutating a subset of your files, you can pass a -filter option containing:Ī relative file path: infection -filter=src/Service/Mailer.phpĪ filename: infection -filter=Mailer.phpĪ relative directory path: infection -filter=src/Service/Ī comma separated list of relative paths: infection -filter=src/Service/Mailer.php,src/Entity/Foobar.phpĪ comma separated list of filenames: infection -filter=Mailer.php,Foobar.php Besides general Symfony Console application command line options, Infection has its own ones.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |