Make WordPress Core

Opened 9 months ago

Closed 8 months ago

#63884 closed defect (bug) (fixed)

Configure logging for multisite PHPUnit configuration

Reported by: desrosj's profile desrosj Owned by: desrosj's profile desrosj
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: good-first-bug has-patch has-unit-tests
Focuses: multisite Cc:

Description

In the phpunit.xml.dist configuration file, [https://core.trac.wordpress.org/browser/trunk/phpunit.xml.dist#L34 logging is configured] using junit`.

When running tests as a multisite, the tests/phpunit/multisite.xml file is used instead. However, this one does not configure any logging.

This can be problematic when certain tools expect logging to be configured in the same way, such as the phpunit-test-runner. The test runner parses the junit.xml file and submits the results to the WordPress.org distributed host tests. When a host runs the tests as a multisite, the runner fails to report the results due to the missing junit.xml file.

Attachments (1)

63884.diff (413 bytes) - added by mehulgitech 8 months ago.
Here’s a patch that adds logging configuration to multisite.xml so PHPUnit can generate junit.xml reports.

Download all attachments as: .zip

Change History (4)

This ticket was mentioned in PR #9614 on WordPress/wordpress-develop by @rishabhwp.


9 months ago
#1

  • Keywords has-patch has-unit-tests added; needs-patch removed

This ticket was mentioned in PR #9616 on WordPress/wordpress-develop by @nimeshatxecurify.


9 months ago
#2

Trac ticket: https://core.trac.wordpress.org/ticket/63884

Added logging for Multisite PHPUnit

@mehulgitech
8 months ago

Here’s a patch that adds logging configuration to multisite.xml so PHPUnit can generate junit.xml reports.

#3 @desrosj
8 months ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from new to closed

In 60781:

Build/Test Tools: Configure logging for PHPUnit and multisite.

This ensures a log file is created after running the PHPUnit test suite as a multisite.

In practice, this file is used by the Host Test Runner to collect a list of failing tests to submit to wordpress.org.

See https://github.com/WordPress/phpunit-test-runner/issues/267.

Props rishabhwp, nimeshatxecurify.
Fixes #63884.

Note: See TracTickets for help on using tickets.