3.0 testsuite cleanup #2993

Merged
merged 3 commits into from Mar 10, 2014

Conversation

Projects
None yet
3 participants
Owner

markstory commented Mar 10, 2014

Cleanup and remove the custom testsuite infrastructure from CakePHP. Now that cakephp/app does not have the webrunner, the only use of this is for the TestShell. I don't think there is much point in keeping TestShell around as it doesn't provide much value over a well built phpunit.xml file.

I've done a few changes to Plugin baking to do the following:

  • Generate a phpunit.xml file.
  • Generate a Test/bootstrap.php file to help ensure the tests have a chance of running.

A few un-resolved problems with plugin baking that I want to fix in the future:

  • Relative paths should be used in both the phpunit.xml and Test/bootstrap.php file.
  • It would be really nice to append into the app's phpunit.xml and add the plugin suites.

markstory added some commits Mar 10, 2014

Remove the remaining test suite infrastructure.
With the removal of the webrunner there isn't much point in keeping all
the test harness infrastructure in place. TestShell also serves little
purpose now, as a tiny wrapper around phpunit is not super useful. If
there is strife around this change we can always reconsider and come to
a better compromise.
Update PluginTask to generate phpunit boilerplate.
There were a few mistakes in the PluginTask. Also make it easier to get
plugins up and running with PHPUnit by generating some boilerplate code.

@markstory markstory added this to the 3.0.0 milestone Mar 10, 2014

Owner

lorenzo commented Mar 10, 2014

How will plugins be tested? Executing the command from within the plugin folder?

Owner

markstory commented Mar 10, 2014

Executing the command from within the plugin folder?

That is one option, another option is to add the plugin suites to your app's phpunit.xml. Then they will be run as part of your app's test cases.

Owner

lorenzo commented Mar 10, 2014

I would rather make people run it from within the directory. I've had plenty bad experiences testing plugins where app stuff pollutes the tests in the plugin, for example routes.

Owner

lorenzo commented Mar 10, 2014

I think this is good 👍

jippi added a commit that referenced this pull request Mar 10, 2014

@jippi jippi merged commit 4a3cbb1 into cakephp:3.0 Mar 10, 2014

1 check passed

default The Travis CI build passed
Details

@markstory markstory deleted the markstory:3.0-testsuite-cleanup branch Mar 10, 2014

Owner

markstory commented Mar 10, 2014

@lorenzo Right now plugin bake will generate separate phpunit.xml files for each plugin. This is a bit flaky as the phpunit.xml file needs a path to the fixtureinjector, which can vary by system. I'm hoping to update plugin task so it can either generate relative paths to the app, or use ./vendor for standalone plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment