Skip to content

feat: Ability to run Fixer with parallel runner 馃帀 #9545

feat: Ability to run Fixer with parallel runner 馃帀

feat: Ability to run Fixer with parallel runner 馃帀 #9545

Triggered via pull request May 8, 2024 09:15
Status Cancelled
Total duration 4m 23s
Artifacts

ci.yml

on: pull_request
Matrix: tests
Matrix: Deployment checks
Fit to window
Zoom out
Zoom in

Annotations

4 errors and 10 warnings
PHP 8.3 code coverage
Canceling since a higher priority waiting request for 'ci-codito/bombazo' exists
PHP 8.3 code coverage
The operation was canceled.
PHP 8.4 tests
Canceling since a higher priority waiting request for 'ci-codito/bombazo' exists
PHP 8.4 tests
The operation was canceled.
PHP 8.3 mutation tests: src/Config.php#L80
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ $this->rules = ['@psr12' => true]; } // @todo 4.0 cleanup - if (Utils::isFutureModeEnabled() || filter_var(getenv('PHP_CS_FIXER_PARALLEL'), FILTER_VALIDATE_BOOL)) { + if (Utils::isFutureModeEnabled() && filter_var(getenv('PHP_CS_FIXER_PARALLEL'), FILTER_VALIDATE_BOOL)) { $this->parallelConfig = ParallelConfigFactory::detect(); } else { $this->parallelConfig = ParallelConfigFactory::sequential();
PHP 8.3 mutation tests: src/Console/Application.php#L69
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $this->add(new ListFilesCommand($this->toolInfo)); $this->add(new ListSetsCommand()); $this->add(new SelfUpdateCommand(new NewVersionChecker(new GithubClient()), $this->toolInfo, new PharChecker())); - $this->add(new WorkerCommand($this->toolInfo)); + } public static function getMajorVersion() : int {
PHP 8.3 mutation tests: src/Console/Application.php#L184
Escaped Mutant for Mutator "InstanceOf_": --- Original +++ New @@ @@ // we need to capture the output of the child process to determine it there was an exception. // Default render format is not machine-friendly, so we need to override it for `worker` command, // in order to be able to easily parse exception data for further displaying on main process' side. - if ($this->executedCommand instanceof WorkerCommand) { + if (true) { $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'code' => $e->getCode(), 'trace' => $e->getTraceAsString()])); return; }
PHP 8.3 mutation tests: src/Console/Application.php#L188
Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ // Default render format is not machine-friendly, so we need to override it for `worker` command, // in order to be able to easily parse exception data for further displaying on main process' side. if ($this->executedCommand instanceof WorkerCommand) { - $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'code' => $e->getCode(), 'trace' => $e->getTraceAsString()])); + $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' > $e->getFile(), 'line' => $e->getLine(), 'code' => $e->getCode(), 'trace' => $e->getTraceAsString()])); return; } parent::doRenderThrowable($e, $output); } }
PHP 8.3 mutation tests: src/Console/Application.php#L189
Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ // Default render format is not machine-friendly, so we need to override it for `worker` command, // in order to be able to easily parse exception data for further displaying on main process' side. if ($this->executedCommand instanceof WorkerCommand) { - $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'code' => $e->getCode(), 'trace' => $e->getTraceAsString()])); + $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' => $e->getFile(), 'line' > $e->getLine(), 'code' => $e->getCode(), 'trace' => $e->getTraceAsString()])); return; } parent::doRenderThrowable($e, $output); } }
PHP 8.3 mutation tests: src/Console/Application.php#L190
Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ // Default render format is not machine-friendly, so we need to override it for `worker` command, // in order to be able to easily parse exception data for further displaying on main process' side. if ($this->executedCommand instanceof WorkerCommand) { - $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'code' => $e->getCode(), 'trace' => $e->getTraceAsString()])); + $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'code' > $e->getCode(), 'trace' => $e->getTraceAsString()])); return; } parent::doRenderThrowable($e, $output); } }
PHP 8.3 mutation tests: src/Console/Application.php#L191
Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ // Default render format is not machine-friendly, so we need to override it for `worker` command, // in order to be able to easily parse exception data for further displaying on main process' side. if ($this->executedCommand instanceof WorkerCommand) { - $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'code' => $e->getCode(), 'trace' => $e->getTraceAsString()])); + $output->writeln(WorkerCommand::ERROR_PREFIX . json_encode(['message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'code' => $e->getCode(), 'trace' > $e->getTraceAsString()])); return; } parent::doRenderThrowable($e, $output); } }
PHP 8.3 mutation tests: src/Console/Command/FixCommand.php#L235
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ if (null !== $passedConfig && null !== $passedRules) { throw new InvalidConfigurationException('Passing both `--config` and `--rules` options is not allowed.'); } - $resolver = new ConfigurationResolver($this->defaultConfig, ['allow-risky' => $input->getOption('allow-risky'), 'config' => $passedConfig, 'dry-run' => $this->isDryRun($input), 'rules' => $passedRules, 'path' => $input->getArgument('path'), 'path-mode' => $input->getOption('path-mode'), 'using-cache' => $input->getOption('using-cache'), 'cache-file' => $input->getOption('cache-file'), 'format' => $input->getOption('format'), 'diff' => $input->getOption('diff'), 'stop-on-violation' => $input->getOption('stop-on-violation'), 'verbosity' => $verbosity, 'show-progress' => $input->getOption('show-progress'), 'sequential' => $input->getOption('sequential')], getcwd(), $this->toolInfo); + $resolver = new ConfigurationResolver($this->defaultConfig, ['config' => $passedConfig, 'dry-run' => $this->isDryRun($input), 'rules' => $passedRules, 'path' => $input->getArgument('path'), 'path-mode' => $input->getOption('path-mode'), 'using-cache' => $input->getOption('using-cache'), 'cache-file' => $input->getOption('cache-file'), 'format' => $input->getOption('format'), 'diff' => $input->getOption('diff'), 'stop-on-violation' => $input->getOption('stop-on-violation'), 'verbosity' => $verbosity, 'show-progress' => $input->getOption('show-progress'), 'sequential' => $input->getOption('sequential')], getcwd(), $this->toolInfo); $reporter = $resolver->getReporter(); $stdErr = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : ('txt' === $reporter->getFormat() ? $output : null); if (null !== $stdErr) {
PHP 8.3 mutation tests: src/Console/Command/FixCommand.php#L276
Escaped Mutant for Mutator "IfNegation": --- Original +++ New @@ @@ $isParallel = $resolver->getParallelConfig()->getMaxProcesses() > 1; $stdErr->writeln(sprintf('Running analysis on %d core%s.', $resolver->getParallelConfig()->getMaxProcesses(), $isParallel ? sprintf('s with %d file%s per process', $resolver->getParallelConfig()->getFilesPerProcess(), $resolver->getParallelConfig()->getFilesPerProcess() > 1 ? 's' : '') : ' sequentially')); // @todo v4 remove the warning - if ($isParallel) { + if (!$isParallel) { $stdErr->writeln(sprintf($stdErr->isDecorated() ? '<bg=yellow;fg=black;>%s</>' : '%s', 'Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!')); } $configFile = $resolver->getConfigFile();
PHP 8.3 mutation tests: src/Console/Command/FixCommand.php#L277
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ $stdErr->writeln(sprintf('Running analysis on %d core%s.', $resolver->getParallelConfig()->getMaxProcesses(), $isParallel ? sprintf('s with %d file%s per process', $resolver->getParallelConfig()->getFilesPerProcess(), $resolver->getParallelConfig()->getFilesPerProcess() > 1 ? 's' : '') : ' sequentially')); // @todo v4 remove the warning if ($isParallel) { - $stdErr->writeln(sprintf($stdErr->isDecorated() ? '<bg=yellow;fg=black;>%s</>' : '%s', 'Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!')); + } $configFile = $resolver->getConfigFile(); $stdErr->writeln(sprintf('Loaded config <comment>%s</comment>%s.', $resolver->getConfig()->getName(), null === $configFile ? '' : ' from "' . $configFile . '"'));