Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re evaluate PHPUnit CLI options #177

Open
2 of 7 tasks
Jean85 opened this issue Jan 24, 2023 · 0 comments · Fixed by #195
Open
2 of 7 tasks

Re evaluate PHPUnit CLI options #177

Jean85 opened this issue Jan 24, 2023 · 0 comments · Fixed by #195

Comments

@Jean85
Copy link
Member

Jean85 commented Jan 24, 2023

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:

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

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:

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:

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'],
];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant