Ticket #149 (closed enhancement: fixed)

Opened 5 months ago

Last modified 4 months ago

Run only a group of tests

Reported by: mikey Assigned to: mikey
Priority: major Milestone: 0.9.0
Component: core Version: SVN-trunk
Keywords: Cc: rist

Description

All unit tests should be grouped with the @group annotation of PHPUnit so that we are able to run only a limited number of tests instead of having to run all tests all the time.

Change History

07/07/08 13:08:29 changed by rist

Note that @group is also possible for classes (no method annotations are needed - see below). A possibility for a group input via phing should also be part of this ticket or should be done as a new ticket.

How @group works (via cmd arg --group): http://sebastian-bergmann.de/archives/697-TestNG-style-Grouping-of-Tests.html

@group for classes explained & possible use cases: http://mikenaberezny.com/2007/09/04/better-phpunit-group-annotations/

07/07/08 23:12:45 changed by mikey

  • status changed from new to assigned.

07/07/08 23:56:51 changed by mikey

Implemented for net::stubbles::console, net::stubbles::ioc, net::stubbles::ipo and net::stubbles::lang with r1701. Other packages will follow.

To run only a group of tests, call phing test -Dtest.group ioc. This will only run all tests for the net::stubbles::ioc package.

Here is a list of currently available groups:

  • console
  • ioc
  • ioc_annotations
  • bug102
  • ipo
  • ipo_interceptors
  • ipo_request
  • ipo_request_broker
  • ipo_request_filter
  • ipo_request_validator
  • ipo_response
  • ipo_session
  • lang
  • lang_errorhandler
  • lang_exceptions
  • lang_initializer
  • lang_serialize

However, runtime improvement of running a group of tests is only around one third compared to running all tests. This is mainly due to PHPUnit still loading all tests because it has to select the tests marked with the @group annotation.

07/08/08 23:37:58 changed by mikey

Added more groups for remaining packages with r1703:

  • peer
  • peer_http
  • peer_ldap
  • php
  • php_serializer
  • php_string
  • rdbms
  • rdbms_criteria
  • rdbms_pdo
  • rdbms_persistence
  • rdbms_querybuilder
  • reflection
  • reflection_annotations
  • service_jsonrpc
  • service_soap
  • streams
  • binford
  • util_cache
  • util_datespan
  • util_log
  • util_xjconf
  • websites
  • websites_cache
  • websites_memphis
  • websites_processors
  • websites_rasmus
  • websites_variantmanager
  • websites_xml
  • xml
  • xml_rss
  • xml_serializer
  • xml_unserializer
  • xml_xsl

Still todo: packages in incubator, allow this option in release-distributed build file as well.

07/08/08 23:45:12 changed by mikey

Implemented for incubator packages with r1704.

07/08/08 23:48:16 changed by mikey

  • status changed from assigned to closed.
  • resolution set to fixed.

Release-distributed build file as well currently do not have a target test.