open-lms-open-source / moodle-plugin-ci

Assist with running a Moodle plugin in Travis CI
https://blackboard-open-source.github.io/moodle-plugin-ci/
GNU General Public License v3.0
42 stars 37 forks source link

Use --configuration instead of --testsuite for running tests #17

Closed stronk7 closed 8 years ago

stronk7 commented 8 years ago

Right now the phpunit execution uses the --testsuite option, using the main generated phpunit.xml file.

While that's ok for the majority of plugins... (_test.php files under component/tests) dir... it maybe insufficient for a number of cases:

So basically this is about to switch from current approach to, recursively, look for any "tests" directory within the plugin and run any _test.php file within them.

This can be easily achieved by:

1) install phpunit with the --buildcomponentconfigs option. That creates a default phpunit.xml within all the components looking for any tests directory within it. 2) run phpunit with the --configuration option pointing to the plugin base directory, so the specialized phpunit.xml will be used and all tests will be run.

Not sure if this should be a general change of behavior or something to be supported by the phpunit "executor" via flag/option. For your consideration.

Ciao :-)

polothy commented 8 years ago

This has been fixed in master, thanks!

stronk7 commented 8 years ago

Yay, working. It's now finding the non-standard-location tests perfectly (no matter they fail because of an OS case-sensitive detail, LOL).

https://travis-ci.org/stronk7/moodle-local_codechecker/jobs/119876880

Thanks!