[wp-trac] [WordPress Trac] #61530: Test tool and unit test improvements for 6.7

WordPress Trac noreply at wordpress.org
Wed Sep 25 03:08:14 UTC 2024


#61530: Test tool and unit test improvements for 6.7
--------------------------------------+---------------------
 Reporter:  jonsurrell                |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  6.7
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by jrf):

 @bjorsch I just checked and my first though was adding a check for
 `WP_RUN_CORE_TESTS`, but kudos to @SergeyBiryukov, that check is already
 in place in the patch as committed.

 So the short of it, as far as I can see, is that plugins test should
 ''not'' be broken by this commit. Plugin integration tests should not set
 the `WP_RUN_CORE_TESTS` PHP constant, or if they do, it should be set to
 `0`.

 Typically, the constant is set like below from the `phpunit.xml[.dist]`
 file when running the Core tests.

 {{{
         <php>
                 <const name="WP_RUN_CORE_TESTS" value="1" />
         </php>
 }}}

 I've also done a test run with a plugin using integration tests with WP
 Core and the tests run just fine for the plugin I tested with.

 I've also checked the template file used by the WP-CLI `scaffold` command
 for the [https://github.com/wp-cli/scaffold-
 command/blob/main/templates/phpunit.xml.dist phpunit.xml.dist]  file and
 it also doesn't include the constant.

 All in all, this sounds like a problem with the plugin integration test
 set up of that particular plugin, not with WP Core.
 @bjorsch Could you please check for the tests where you noticed the
 failure that the constant is ''not'' being set ?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61530#comment:52>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list