moodle-plugin-ci icon indicating copy to clipboard operation
moodle-plugin-ci copied to clipboard

Add support for --testsuite, --config, --filter to phpunit runs

Open stronk7 opened this issue 4 years ago • 1 comments

By default, phpunit is always executed with the --configuration option that uses the plugin own phpunit.xml created on init (that is executed by default with the --buildcomponentconfigs that creates those distributed files.

And that's ok 99% of times (default behavior).

No matter of that, sometimes you may want to run some other testsuite (elsewhere in code), or maybe point to another, custom, phpunit configuration file. Or, also, filter the run to any class or test.

So this issue is about to allow the phpunit command to accept and handle properly these 3 options:

  • --testsuite
  • --configuration
  • --filter

The use of any of them should stop the default behavior to be applied, getting precedence.

Ciao :-)

stronk7 avatar May 13 '21 12:05 stronk7

We found an easy workaround, just call phpunit directly:

cd moodle
vendor/bin/phpunit --filter tool_dataprivacy_metadata_registry_testcase

marinaglancy avatar May 13 '21 14:05 marinaglancy