tzepart / test-separator
Project for separating of tests
Requires
- php: >=7.1
- ext-json: *
- ext-simplexml: *
- codeception/codeception: ^4.0
- drupol/phpartition: ^0.1.2
- psr/log: ^1.1
- symfony/console: ^4.4
- symfony/finder: ^4.4
Requires (Dev)
- phpunit/phpunit: ^7.5
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2026-06-09 02:31:22 UTC
README
Packagist - https://packagist.org/packages/tzepart/test-separator
Description:
It is possible to divide the tests into groups based on:
- report.xml of Codeception library
- The size of the test methods (used if the first 2 do not work)
In addition, the separation depth has 3 levels:
- Separation of directories
- Separation of files (classes)
- Separation by separate methods Than smaller the division unit (method < class < directory) that more optimized the division result.
Installation
composer require tzepart/test-separator
Configuration
Add configuration file config/test_separator.yml, which contents:
test_separator: separating-strategy: 'default-groups' use-default-separating-strategy: false codeception-reports-directory: '/path/to/file/with/codeception/reports/' tests-directory: '/path/to/project/tests/' result-path: '/path/to/project/file/groups/' level: 'method' test-suites-directories: - 'list' - 'sub-directories' - 'with' - 'test-suites' default-separating-strategies: - 'method-size' - 'default-groups' default-groups-directory: '/path/to/directory/with/defaults/groups/'
Parameter separating-strategy can be one of these values:
- codeception-report
- method-size
If parameter use-default-separating-strategy: true than, if we can't use codeception-report strategy we'll try use default strategies (method-size or default-groups)
Parameter tests-directory - path to directory where is yours tests
Parameter result-path - path to directory where final groups files will be
Parameter level can be one of these values:
- directory
- class
- method
Manual running
./vendor/bin/separate-tests separate 6
Where "6" - groups count
For the convenience of debugging, you can overwrite some configuration parameters when running the command, namely:
- codeception-reports-directory
- result-path
- separating-strategy
Example:
./separate-tests separate 5 --result-path=/data/tests-separator-data/groups_2/ --codeception-reports-directory=/data/tests-separator-data/reports_2/
Develop section
Run test
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests