Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 7 months ago

#56022 closed defect (bug) (fixed)

Enable coverage mode for xDebug in local Docker environment

Reported by: desrosj's profile desrosj Owned by: desrosj's profile desrosj
Milestone: 6.1 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

Recently, the version of xDebug included in the PHP 7.2-7.4 Docker containers was changed from 2.x to 3.x.

One of the changes in xDebug 3.0 was a shift from enabling features to switching xDebug into modes (see the 2.x to 3.0 upgrade documentation). By default, xDebug is in develop mode. However, in order to generate code coverage reports the coverage mode needs to be active.

The code coverage reporting workflow currently runs on PHP 7.4, and was affected by this change. The Code Coverage workflow has not been able to generate a coverage report since then.

Change History (9)

This ticket was mentioned in PR #2832 on WordPress/wordpress-develop by desrosj.


3 years ago
#1

This enables the coverage mode for xDebug in the local Docker environment in addition to the default mode of develop by passing the XDEBUG_MODE environment variable to the container.

This environment variable takes precedent, but does not change the value of xdebug.mode. For more information, see the xDebug documentation about modes.

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

#2 @desrosj
3 years ago

  • Owner set to desrosj
  • Status changed from new to assigned

afragen commented on PR #2832:


3 years ago
#3

Any reason not to include debug for step debugging?

desrosj commented on PR #2832:


3 years ago
#4

Any reason not to include debug for step debugging?

@afragen No reason other than I hadn't considered it. Since the environment is meant for local Core development, I think that's reasonable to include.

I looked into performance implications, and looks like `coverage` slows down Xdebug the most (though less on Xdebug 3.0). I've switched the default to develop,debug and updated the workflow to use the environment variable to change the mode to coverage.

desrosj commented on PR #2832:


3 years ago
#5

Any reason not to include debug for step debugging?

@afragen No reason other than I hadn't considered it. Since the environment is meant for local Core development, I think that's reasonable to include.

I looked into performance implications, and looks like `coverage` slows down Xdebug the most (though less on Xdebug 3.0). I've switched the default to develop,debug and updated the workflow to use the environment variable to change the mode to coverage.

#6 @desrosj
3 years ago

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

In 53552:

Build/Test Tools: Configure Xdebug modes in the local Docker environment.

One change in the update from Xdebug version 2.x to 3.x was a shift from enabling features to switching into modes.

When the version of Xdebug installed in the PHP 7.4 Docker container was updated from 2.x to 3.x, the code coverage reporting workflow stopped generating reports due to a lack of available coverage drivers.

This change adds the XDEBUG_MODE environment variable to the local Docker environment configuration to allow the active modes to be changed. This environment variable takes precedence over the xdebug.mode setting, but will not change the value of the xdebug.mode setting.

The LOCAL_PHP_XDEBUG_MODE environment variable has been added to the .env file and can be used to change the modes enabled in the Docker container. The code coverage reporting workflow uses this variable to enable the coverage mode, which is required for generating a test coverage report.

By default, debug and `debug modes are active, which enables the more commonly used features of Xdebug: development helpers and step debugging.

Props afragen, johnbillion, desrosj.
Fixes #56022.

This ticket was mentioned in Slack in #core by sergey. View the logs.


3 years ago

#9 @desrosj
7 months ago

In 58605:

Build/Test Tools: Make use of new reusable workflows for 5.6.

This updates the 5.6 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Run E2E tests with and without SCRIPT_DEBUG (#58661).
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.
  • Cache the results of PHP_CodeSniffer runs (#49783).
  • Move the Memcached container into the Docker Compose config (#55700).
  • Configure Xdebug modes in the local Docker environment (#56022).
  • Improvements to the healthcheck command for the mysql container (#58867).
  • A fix to grunt clean to prevent script-loader-packages.php from being deleted (#53606).

Merges [51355], [51673], [52179], [53552], [53895], [56113], [56114], [56464], [57918], [58157], [57124], [57125], [57249] to the 5.6 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen, jrf.
See #49783, #58867, #61340, #60822, #61216, #60901, #61101, #56022, #59416, #59805, #61213, #58661, #53606.

Note: See TracTickets for help on using tickets.