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
- dev-master
- 4.1.0
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.1.0
- 3.0.1
- 3.0.0
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.1
- 1.0.0
- 0.1.1
- 0.1.0
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-task-add-logger
- dev-task-work-only-in-test-suites-directories
- dev-task_test_separation_v2
- dev-task_4_config_settings_via_symfony_configuration_by_yaml
- dev-task_5_logic_separating_if_reports_dont_exist
- dev-task_7_logic_of_finding_tests_by_classes_map
- dev-task_13_separating_tests_by_codeception_report
This package is auto-updated.
Last update: 2024-10-08 22:55:52 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