-
Notifications
You must be signed in to change notification settings - Fork 18
Description
After #174, PHPUnit CLI options should be re evaluated. Any option that doesn't affect Paraunit's behavior should be dropped, while newer ones should be incorporated and passed through. In this issue, We will cover just writing a self-documenting test that will extrapolate the situation of each option (so that it could be linked from the docs) and emit a warning when a new option is discovered.
Unusable
Done in #195: These options should be incompatible with Paraunit; we should document fail when detecting those (see #174)
This list is available in here in the code:
paraunit/src/Configuration/PassThrough.php
Lines 9 to 24 in 0810462
| private const DISALLOWED_OPTIONS = [ | |
| '--no-configuration', | |
| '--no-extensions', | |
| '--no-logging', | |
| '--coverage-php', | |
| '--teamcity', | |
| '--testdox', | |
| '--atleast-version', | |
| '--check-version', | |
| '--generate-configuration', | |
| '--migrate-configuration', | |
| '--list-suites', | |
| '--list-groups', | |
| '--list-tests', | |
| '--list-tests-xml', | |
| ]; |
To be handled in the future
- Handle
--columnoption #196 - Handle all
--display-*options #197 - Handle all
--stop-on-*options #198 - Handle
--exclude-testsuiteand--test-suffixoptions #199 - Handle
--order-byand--random-order-seedoptions #200 - Handle
--warm-coverage-cacheoption #201 - Add support for cobertura #157
To be ignored / used with --passthrough
The following options should be only listed in the test as allowed, so that no warning is triggered in the self-documenting test: are listed in this test data provider for the self-documenting test:
paraunit/tests/Functional/Configuration/PassThroughTest.php
Lines 74 to 94 in 0810462
| private function getAlreadySupportedOptions(): array | |
| { | |
| $coverageCommand = new CoverageCommand($this->prophesize(CoverageConfiguration::class)->reveal()); | |
| $supportedOptions = array_map( | |
| static fn (InputOption $option): string => '--' . $option->getName(), | |
| $coverageCommand->getDefinition()->getOptions(), | |
| ); | |
| $supportedOptions[] = '--filter'; | |
| $supportedOptions[] = '--help'; | |
| $supportedOptions[] = '--version'; | |
| // TODO - map coverage modes automatically | |
| $supportedOptions[] = '--coverage-clover'; | |
| $supportedOptions[] = '--coverage-html'; | |
| $supportedOptions[] = '--coverage-xml'; | |
| $supportedOptions[] = '--coverage-text'; | |
| $supportedOptions[] = '--coverage-crap4j'; | |
| return array_values($supportedOptions); | |
| } |
Usable
The following options are usable with --pass-through and listed in this test data provider for the self-documenting test:
paraunit/tests/Functional/Configuration/PassThroughTest.php
Lines 126 to 170 in 0810462
| public static function allowedOptionsDataProvider(): array | |
| { | |
| return [ | |
| ['--bootstrap', '<file>'], | |
| ['--include-path <path(s)>'], | |
| ['-d <key[=value]>'], | |
| ['--cache-directory', '<dir>'], | |
| ['--testsuite', '<name>'], | |
| ['--group', '<name>'], | |
| ['--exclude-group', '<name>'], | |
| ['--covers', '<name>'], | |
| ['--uses', '<name>'], | |
| ['--process-isolation'], | |
| ['--globals-backup'], | |
| ['--static-backup'], | |
| ['--strict-coverage'], | |
| ['--strict-global-state'], | |
| ['--disallow-test-output'], | |
| ['--enforce-time-limit'], | |
| ['--default-time-limit', '<sec>'], | |
| ['--cache-result'], | |
| ['--do-not-cache-result'], | |
| ['--colors', '<flag>'], | |
| ['--stderr'], | |
| ['--no-progress'], | |
| ['--no-output'], | |
| ['--log-junit', '<file>'], | |
| ['--log-teamcity', '<file>'], | |
| ['--testdox-html', '<file>'], | |
| ['--testdox-text', '<file>'], | |
| ['--log-events-text', '<file>'], | |
| ['--log-events-verbose-text', '<file>'], | |
| ['--coverage-filter', '<filter>'], | |
| ['--disable-coverage-ignore'], | |
| ['--path-coverage'], | |
| ['--no-coverage'], | |
| ['--include-path'], | |
| // TODO - add dedicated tests? | |
| ['--fail-on-incomplete'], | |
| ['--fail-on-risky'], | |
| ['--fail-on-skipped'], | |
| ['--fail-on-warning'], | |
| ['--dont-report-useless-tests'], | |
| ]; | |
| } |