[wp-trac] [WordPress Trac] #56807: Delete existing attachment subsizes after WP_Customize_Manager tests

WordPress Trac noreply at wordpress.org
Sat Oct 15 00:57:02 UTC 2022


#56807: Delete existing attachment subsizes after WP_Customize_Manager tests
--------------------------------------+-----------------------------
 Reporter:  ironprogrammer            |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  accepted
 Priority:  normal                    |   Milestone:  6.1
Component:  Build/Test Tools          |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 I was curious why I didn't see the leftover files when running the tests
 on Windows.

 It looks like this has to do with one of the test failures mentioned in
 #50664:
 {{{
 1) Tests_WP_Customize_Manager::test_import_theme_starter_content
 Expected reuse of non-auto-draft attachment.
 Failed asserting that an array contains 949.

 S:\home\wordpress.test\develop\tests\phpunit\tests\customize\manager.php:691
 }}}

 Upon some investigation, the file is saved with an incorrect path on
 Windows:
 {{{
 S:\home\wordpress.test\develop-dynamic-properties/src/wp-
 content/uploads/S:homewordpress.testdevelop-dynamic-
 propertiestestsphpunitincludes/../data/images/canola.jpg
 }}}
 so it's not detected as an existing attachment. The path probably needs to
 be normalized at some point. This should be further explored in #50664.

 I was able to reproduce the leftover files when running the tests under
 WSL. The PR works as expected.

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


More information about the wp-trac mailing list