Open antonkomarev opened 4 days ago
Found a workaround using lifecycle hooks:
return [
'outputDirectory' => './tests/allure-results',
'lifecycleHooks' => [
new class implements BeforeTestStartHookInterface, BeforeContainerStartHookInterface {
public function beforeContainerStart(
ContainerResult $container,
): void {
if (!$this->isReportEnabled()) {
$container->setExcluded(true);
}
}
public function beforeTestStart(
TestResult $test,
): void {
if (!$this->isReportEnabled()) {
$test->setExcluded(true);
return;
}
}
private function isReportEnabled(): bool
{
return boolval(getenv('ALLURE_REPORT_ENABLED'));
}
},
],
];
Is your feature request related to a problem? Please describe. I want to avoid writing allure reports all the time on the developer local machine.
Describe the solution you'd like I want to have some kind of environment or argument for the PHP CLI command to enable report writing.
Some kind like
Describe alternatives you've considered I understand that developers might have local phpunit.xml, but it's not an easy to manage multiple configurations.