Make our test runner a bit smarter #6633
Labels
c: Platform
For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.
c: Tests & QA
For issues related to automated tests or making it easier to QA & test issues.
Task
Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone
Currently, it is possible to execute tests by "testsuite", "group" and "file/dir":
./console tests:run --testsuite unit --file tests/PHPUnit/file.php groupName
The argument is currently interpreted as a group. I'd suggest to make this argument a bit smarter.
./console tests:run unit
./console tests:run Insights
. It would be nice if lower case was possible as well..php
search for a while having this name in tests folder eg./console tests:run Widgets.php
. To be defined if multiple files have this name. Can we specify multiple files in PHPUnit maybe? --> NO. Maybe instead let the user choose which one should be executed (eg enter number:[1] foo/bar.php, [2] bar/bar.php
)tests/PHPUnit
,plugins/
or iffile_exists
interpret it as file / directory--group
? I'd prefer the first one as it could be possible that there is eg a group having the given name but you thought you were executing plugin tests or whatever. Eg if there is a typo etc../console tests:run unit Insights
run all unit tests of the insights plugin? Could be niceIf someone specifies a
--testsuite
option and a argument namedunit
we should maybe interpret the argument as group? Same for--file
etc.This will allow us to remove some current groups. Executing groups is not so useful currently as they are not always set and very inconsistent. Eg not all tests in plugins have the group name set. This way we kinda gain "dynamical groups" that actually work.
As this adds some kind of magic and someone might still want to execute a group "unit" or "Insights" we should add another option
--group
so people can still avoid the magic and it will be more consistent with--testsuite
and--file
and with PHPUnit command line parameters.The text was updated successfully, but these errors were encountered: