Skip to content

Add CLI flag to generate only one type of CC & Logging regardless of phpunit.xml #4401

@Slamdunk

Description

@Slamdunk

Hi, I'm the current maintainer of https://github.com/paratestphp/paratest, a tool to run PHPUnit in parallel, leveraging sub-processes.

A feature we must provide is to generate code-coverage and logging accordingly to phpunit.xml specifications.

Our tool should:

  1. Read phpunit.xml <filter/coverage> and <logging> sections, which may all set to all the available configurations
  2. Disable all of them during ParaTest process
  3. Enable only coverage-php and log-junit into PHPUnit sub-processes
  4. Wait for sub-processes to finish and to generate the only two cc+log above
  5. Merge everything together within ParaTest process
  6. Generate the desired cc/logs respecting again phpunit.xml <filter/coverage> and <logging> sections

As of yet this can't be done because if <filter/coverage> and <logging> sections are specified in phpunit.xml, cc and logs are always generated except with --no-coverage/--no-logging active, but with --no-coverage/--no-logging active no cc nor logs are generated at all.

The workaround we are using right now is suggesting not to have any section in phpunit.xml except the <whitelist> one, and specify each option in the CLI, so ParaTest can easily rewrite them as wish, but of course this is sub-optimal.

So I'm asking something like vendor/bin/phpunit --no-coverage --coverage-php tmp.php --no-logging --log-junit tmp.log.

If you so kind to write down few instructions to how and where implement such feature, I'm happy to propose a PR.

Metadata

Metadata

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions