Remove TestRunner from 4.0?

已查看 62 次
跳至第一个未读帖子

Ingo Schommer

未读,
2015年5月31日 23:19:272015/5/31
收件人 silverst...@googlegroups.com
In order to reduce complexity in core, I'd like to suggest removing the TestRunner functionality to run PHPUnit tests via the "sake" binary in 4.0.
This is a bit of a historical artefact from early 2.x releases when we didn't support the "phpunit" binary directly.
Nowadays we bundle "phpunit" through composer, and it doesn't need all this scaffolding.
In fact, the "phpunit" binary is a lot more powerful (e.g. filtering by method name), see https://phpunit.de/manual/3.7/en/textui.html#textui.clioptions
Particularly in the light of the recent 3.1.13 release, I'm keen to reduce our "security surface" on things like development tasks.

What will change:
- No more test execution via web browser. That's probably the most contentious change, but my take is that devs caring about unit testing should be comfortable with basic CLI tooling, or have an IDE which can provide a UI like PHPStorm. Can somebody think of a good reason that you'd want to run unit tests on a webroot where you don't have CLI access?
- dev/tests/coverage: Built-in to PHPUnit, already described on http://docs.silverstripe.org/en/3.0/howto/phpunit-configuration/
- dev/tests/browse: Listing available tests 
- dev/tests/module: Simply point the "phpunit" binary at a folder
- dev/tests/suite: phpunit --testsuite
- dev/tests/all: Simply let phpunit auto-discover tests on the webroot
- dev/tests/SomeTest,SomeOtherTest: No replacement, can be emulated with suites in phpunit.xml
- SkipTests=1: Can be emulated with --filter

What's required:
- Remove TestRunner.php and SapphireTestSuite.php
- Move TestRunner::$coverage_filter_dirs to phpunit.xml.dist
- Move TestRunner::use_test_manifest() to SapphireTest
- Move dev/tests/cleanupdb to a new BuildTask

I'd also like to remove JSTestRunner.php for similar reasons: It doesn't provide any benefit over a Gruntfile, tooling has moved on since it was written, and it hasn't been used much in practice.

Any objections?

Cam Findlay

未读,
2015年6月1日 17:19:422015/6/1
收件人 silverst...@googlegroups.com、in...@silverstripe.com
Maybe raise as an RFC? If you whip this up today it can be discussed at the next core committers hangout (which is a private one tomorrow).

C

Ingo Schommer

未读,
2015年6月8日 02:37:322015/6/8
收件人 silverst...@googlegroups.com、c...@silverstripe.com、in...@silverstripe.com
回复全部
回复作者
转发
0 个新帖子