[wp-trac] [WordPress Trac] #40531: Avoid test skipping for multisite only or single site only tests

WordPress Trac noreply at wordpress.org
Sat Apr 22 17:05:05 UTC 2017


#40531: Avoid test skipping for multisite only or single site only tests
------------------------------+-------------------------
 Reporter:  johnbillion       |      Owner:
     Type:  task (blessed)    |     Status:  new
 Priority:  normal            |  Milestone:  4.8
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  needs-patch
  Focuses:  multisite         |
------------------------------+-------------------------
 When running the core test suite with PHPUnit you'll never see a nice
 green `OK` result, because there are always skipped tests for multisite
 specific and single site specific tests.

 Example:

 {{{
 if ( ! is_multisite() ) {
         $this->markTestSkipped( 'This test requires multisite.' );
 }
 }}}

 The consequence is that it's difficult to spot unexpectedly skipped tests
 or incomplete tests, because there are always skipped tests polluting the
 results.

 Instead of using the `is_multisite() -> markTestSkipped` pattern, all
 these tests should be put into `ms-required` and `ms-only` groups, and
 then the `phpunit.xml`/`multisite.xml` configuration files should be
 updated to control whether the corresponding groups are skipped.

 The `is_multisite() -> markTestSkipped` code should remain (at least for
 now, maybe permanently) so the tests in those groups don't cause failures
 if they are run when they shouldn't be.

 The aim is to attempt to remove all skipped tests when running the test
 suite, at least on Travis and ideally locally too. TDB whether or not this
 is achievable.

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


More information about the wp-trac mailing list