Make WordPress Core

Opened 9 months ago

Closed 8 months ago

#41698 closed defect (bug) (fixed)

Tests in the ms-files group are never run

Reported by: johnbillion Owned by: jeremyfelt
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: multisite Cc:


Tests in the ms-files group are not run by default, but there is also no configuration under which Travis CI (grunt travis:phpunit) or a local test run (grunt test) will run these tests.

Not running ms-files tests. To execute these, use --group ms-files.

A sub-task should be added to the phpunit task in Gruntfile.js to run these tests in the same way that the other excluded test groups such as ajax and external-http are run.

Attachments (1)

41698.diff (519 bytes) - added by netweb 9 months ago.

Download all attachments as: .zip

Change History (6)

9 months ago

#1 @netweb
9 months ago

  • Keywords has-patch added; needs-patch removed


  • Single Site: #36566 Improve unit tests around multisite's bootstrap, networks, and sites / [37269]
  • Multisite: #30256 Create and exclude an area for ms-files.php specific unit tests / [30286]

cc @jeremyfelt As both above tickets were yours do you have any concerns on adding the ms-files group of tests into its own multisite test group for Travis CI?

Testing 41698.diff in my local fork:

Here's the first job passing with flying colours:

Running "phpunit:ms-files" (phpunit) task
Installing network...
Running as multisite...
Not running ajax tests. To execute these, use --group ajax.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 6.3.0 by Sebastian Bergmann and contributors.
Runtime:       PHP 7.1.8
Configuration: /home/travis/build/ntwb/wordpress/tests/phpunit/multisite.xml
..                                                                  2 / 2 (100%)
You should really fix these slow tests (>150ms)...
 1. 351ms to run Tests_Multisite_MS_Files_Rewriting:test_switch_upload_dir
 2. 313ms to run Tests_Multisite_MS_Files_Rewriting:test_upload_directories_after_multiple_wpmu_delete_blog_with_ms_files
Time: 3.28 seconds, Memory: 88.00MB
Last edited 9 months ago by netweb (previous) (diff)

#2 @johnbillion
9 months ago

  • Milestone changed from Awaiting Review to 4.9
  • Owner set to jeremyfelt
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.

8 months ago

#4 @jeremyfelt
8 months ago

I like this, thanks @netweb. For some reason I remembered the ms-files group being a lot more complicated than those few tests, but it doesn't add much time at all.

#5 @jeremyfelt
8 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 41659:

Build/Test Tools: Add ms-files test group to sub-task list.

Previously, the ms-files test group would not run in any automatic configuration. This ensures it is always run as part of the test suite in Travis CI.

Props netweb.
Fixes #41698.

Note: See TracTickets for help on using tickets.