[wp-trac] [WordPress Trac] #61238: Tests: Ticket annotations should not include any trailing characters

WordPress Trac noreply at wordpress.org
Fri May 17 08:39:43 UTC 2024


#61238: Tests: Ticket annotations should not include any trailing characters
------------------------------+-----------------------------
 Reporter:  jonsurrell        |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 PHPUnit tests use the `@ticket 1234` annotation to reference tickets, but
 are also used as a PHPUnit group so that tests can be filtered like this:

 {{{
 phpunit --group 1234
 }}}

 Where only tests with the `@ticket 1234` will run (or a `1234` group).

 Some annotations include additional characters, such as a full stop "." or
 other details on the ticket line. This breaks the group-based ticket
 filtering.

 Some changes would improve things:

 - Trailing characters should be removed from the ticket numbers.
 - The ticket to group matching should trim the ticket number from the
 annotation to match only the initial digits (something like `/^\d+/`).
 - A PHP code sniff could prevent adding extra characters to the ticket
 number.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61238>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list