Skip to content

Added --testsuite argument, allowing to filter files/directory by parent testsuite name attribute#494

Closed
jpic wants to merge 1 commit intosebastianbergmann:3.6from
jpic:3.6
Closed

Added --testsuite argument, allowing to filter files/directory by parent testsuite name attribute#494
jpic wants to merge 1 commit intosebastianbergmann:3.6from
jpic:3.6

Conversation

@jpic
Copy link
Copy Markdown
Contributor

@jpic jpic commented Feb 9, 2012

Before, we could run the test suite of a component as such: UnitTest/src/runtests.php Database

But the new test runner does not allow this. For example, consider this phpunit.xml.dist: https://fisheye6.atlassian.com/browse/zetacomponents/trunk/phpunit.xml.dist?hb=true

Phpunit --filter Database will not behave as expected in two ways:

  1. test cases without Database in the class name will be omited (ie. ezcQueryExpressionTest from Database/tests/sqlabstraction/expression_test.php)
  2. test cases with Database in the class name from other components will be included (ezcDatabaseSchemaGenericTest from DatabaseSchema/tests/generic_test.php)

As a more alarming example: --filter MvcTools runs 124 tests, wheras --testsuite MvcTools runs 168.

Credit to Derick Rethans who participated in this little task. Long live the Components !

@edorian
Copy link
Copy Markdown
Contributor

edorian commented Feb 9, 2012

What would work right now for filtering is phpunit MvcTools/tests/ but in general I agree that the test suite name should be something that can be used to filter tests. When building test suites from more than one folder that would allow to have some "value" in that organizational structure

@sebastianbergmann
Copy link
Copy Markdown
Owner

This is a new feature. As such it cannto go into the PHPUnit 3.6 branch. Please send a pull request against master. Thanks!

@jpic
Copy link
Copy Markdown
Contributor Author

jpic commented Feb 9, 2012

@edorian No, that doesn't work here!

<<< 17:24.17 Thu Feb 09 2012!~/zeta/trunk
<<< jpic@germaine!10074 env

../phpunit/phpunit/phpunit.php MvcTools/tests
PHPUnit @package_version@ by Sebastian Bergmann.

Configuration read from /home/jpic/zeta/trunk/phpunit.xml.dist

Time: 0 seconds, Memory: 4.00Mb

OK (0 tests, 0 assertions)

@jpic
Copy link
Copy Markdown
Contributor Author

jpic commented Feb 9, 2012

New pull request: #495

@edorian
Copy link
Copy Markdown
Contributor

edorian commented Feb 9, 2012

@jpic Oh yeah, because of the _test.php directory suffix. My bad. Thanks for pointing that out :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants